Add experimental build 3 and options
[?]
Apr 11, 2021, 3:14 AM
DLDMHQY6F53N2YXNDBQY77GAU2I4N2OWC3DL6L36T2SSAVW6YSXACDependencies
- [2]
RE4EKNSLImprovements, a lot - [3]
ISO7J5ZHMore caches, better and generic cache code. Now Dracon listen to file changes to drop cached data. Implemented caches: - File contents in specific revision (never dropped) - Pijul ls and Pijul diff results - File Revision and File changes by patch - some others.. Dracon is incredible fast now, but still will take some time for bigger repos. - [4]
2N67RQZCAdd auto installation support and cache content of ContentRevision - [5]
5AUENX2YAdd support to view files affected by a revision - [6]
6CR2EFUNFirst ChangeProvider implementation!!! Wheehooo - [7]
B43WNBLF- Add Show History to Pijul menu - Always ignore .idea and .pijul in tracking. - Make findPijul a generic function to allow to find editor-server. - Only show one revision for directories. - Add `Hunk::resolvePath(Path)` to resolve the affected file to a Java NIO Path. - Fix StringOutOfBounds in Change Parsering Algorithm - Use editor-server instead of copie for interfacing with `pijul record` file. - Fix FileStatus provider not returning correctly for untracked files. - Add CommittedChangesProvider for Pijul. - [8]
A7IL6I3VMore files to support .ignore - [9]
OMZXJL6QReady for pijul push! First nightly build will be released shortly! - [10]
Q35OTML2Remove use of coroutines, which was blocking IntelliJ UI in larger repositories Improvements for bigger repositories, now Dracon caches the changes that happened in a revision in a file, so everytime Dracon needs to query the changes of a revision, it loads directly from memory instead of doing a full-scan in Pijul repository. For tiny projects it is not a problem, but for medium ones it takes more than five minutes to scan the entire repository (and it was tested with a repo of only 700 records, however there was changes that had more than 60.000 lines). The cache file is saved in IntelliJ Data Path (project specific) and is compressed with gzip, so it will not use so much disk space (the cost worths the gains). - [11]
FRFFQV7VBasic show history support. - [12]
Q7FXTHVUFirst record support, YEAAAH, RECOOORD - [13]
FNNW5IEAAdded more plugin files to Pijul - [14]
QXUEMZ3BInitial CahngeProvider - [15]
37OJKSWJImproved caching code a lot - [*]
GGYFPXNDInitial plugin - [*]
ZCRW57C5Improved support for revisions - [*]
OPFG6CZ2File status tracking supported. - [*]
MZYZIVHYFirst experimental build, it seems like it is breaking Git plugin, however, it still something =D
Change contents
- edit in src/main/resources/messages/DraconBundle.properties at line 93
remote.invalid.remote.text=Invalid remote server {0}...command.execute.text=Executing command in terminal... - replacement in src/main/resources/messages/DraconBundle.properties at line 97
remote.invalid.remote.text=Invalid remote server {0}...[3.10309]settings.title=Dracon (Pijul)settings.pijul.path.text=Pijul path:settings.pijul.path.detect.text=Detectsettings.pijul.path.select.text=Select Pijul Binarysettings.dracon.index.all.text=Index all revisionssettings.dracon.index.all.tooltip.text=Enable caching of all revisions, it does speed up revision loading however \caching uses a bunch of storage space and takes a bit of more time at first loading. - edit in src/main/resources/META-INF/plugin.xml at line 54
<applicationConfigurable parentId="tools" instance="com.github.jonathanxd.dracon.component.PijulSettingsConfigurable"id="com.github.jonathanxd.dracon.component.PijulSettingsConfigurable"displayName="Dracon (Pijul)"/> - edit in src/main/resources/META-INF/plugin.xml at line 59
<applicationService serviceImplementation="com.github.jonathanxd.dracon.config.PijulSettings"/> - edit in src/main/kotlin/com/github/jonathanxd/dracon/push/PijulPusher.kt at line 33
- replacement in src/main/kotlin/com/github/jonathanxd/dracon/push/PijulPusher.kt at line 35
val push = pijul(project).push(val push = pijul(project).pushInTerminal( - replacement in src/main/kotlin/com/github/jonathanxd/dracon/push/PijulOutgoingChangesProvider.kt at line 34
val r = pijul(project).push(project, ctx.root, fromChannel, toChannel, toRemote) {val r = pijul(project).pushInTerminal(project, ctx.root, fromChannel, toChannel, toRemote) { - edit in src/main/kotlin/com/github/jonathanxd/dracon/pijul/Pijul.kt at line 135
fun pushInTerminal(project: Project, root: Path,fromChannel: String? = null,toChannel: String? = null,repository: String? = null,editorServerConsumer: (EditorServer) -> Unit): PijulOperationResult<String>@RequiresBackgroundThread - file move: handler → handler
- file addition: exec[3.107]
- file addition: Terminal.kt[0.1398]
package com.github.jonathanxd.dracon.execimport com.github.jonathanxd.dracon.i18n.BUNDLEimport com.github.jonathanxd.dracon.i18n.DraconBundleimport com.intellij.execution.configurations.GeneralCommandLineimport com.intellij.execution.process.ProcessOutputimport com.intellij.execution.util.ExecUtilimport org.jetbrains.annotations.PropertyKeyimport java.nio.file.Pathfun execInTerminal(@PropertyKey(resourceBundle = BUNDLE) name: String,command: String) {ExecUtil.execAndGetOutput(GeneralCommandLine(ExecUtil.getTerminalCommand(DraconBundle.message(name), command)))}fun execInTerminal(@PropertyKey(resourceBundle = BUNDLE) name: String,vars: Map<String, String>,workDir: Path,command: String): ProcessOutput {val cmd = GeneralCommandLine(ExecUtil.getTerminalCommand(DraconBundle.message(name), command))cmd.environment.putAll(vars)cmd.workDirectory = workDir.toFile()return ExecUtil.execAndGetOutput(cmd)}fun terminalCommand(@PropertyKey(resourceBundle = BUNDLE) name: String,command: String): List<String> {return ExecUtil.getTerminalCommand(DraconBundle.message(name), command)} - edit in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 3
import com.github.jonathanxd.dracon.util.findBinaryimport com.github.jonathanxd.dracon.util.findBinaryOrNull - replacement in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 11
@State(name = "Pijul.Settings", storages = [Storage(StoragePathMacros.WORKSPACE_FILE)])@State(name = "Pijul.Settings", storages = [Storage("DraconSettings.xml")]) - edit in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 13
companion object {val instance get() = service<PijulSettings>()} - edit in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 31
fun saveToCacheAllRevisions(cacheAllRevisions: Boolean) {this.state.cacheAllRevisions = cacheAllRevisions}fun savePathToPijul(pathToPijul: String?) {this.state.pathToPijul = pathToPijul}fun getPathToPijul() =this.state.pathToPijul - replacement in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 57
var pathToGit by string()var pathToPijul by string(defaultValue = findBinaryOrNull("pijul")) - replacement in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 60
var cacheAllRevisions by property(defaultValue = true)var cacheAllRevisions by property(defaultValue = false) - file addition: component[3.107]
- file addition: PijulSettingsConfigurable.kt[0.3292]
package com.github.jonathanxd.dracon.componentimport com.github.jonathanxd.dracon.config.PijulSettingsimport com.github.jonathanxd.dracon.i18n.DraconBundleimport com.intellij.openapi.options.Configurableimport javax.swing.JComponentclass PijulSettingsConfigurable: Configurable {private var pijulSettingsComponent: PijulSettingsComponent? = nulloverride fun createComponent(): JComponent =PijulSettingsComponent().let {this.pijulSettingsComponent = itit}.mainPaneloverride fun getPreferredFocusedComponent(): JComponent? =this.pijulSettingsComponent?.preferredFocusedComponentoverride fun isModified(): Boolean {val settings = PijulSettings.instanceval pathToPijul = settings.getPathToPijul()val cacheAllRevisions = settings.isToCacheAllRevisions()var modified = this.pijulSettingsComponent?.pijulPath?.text != pathToPijulmodified = modified || (this.pijulSettingsComponent?.indexAllRevisions?.isSelected == cacheAllRevisions)return modified}override fun apply() {val settings = PijulSettings.instancesettings.savePathToPijul(this.pijulSettingsComponent?.pijulPath?.text)settings.saveToCacheAllRevisions(this.pijulSettingsComponent?.indexAllRevisions?.isSelected ?: false)}override fun getDisplayName(): String =DraconBundle.message("settings.title")override fun reset() {val settings = PijulSettings.instancethis.pijulSettingsComponent?.pijulPath?.text = settings.getPathToPijul() ?: ""this.pijulSettingsComponent?.indexAllRevisions?.isSelected = settings.isToCacheAllRevisions()}override fun disposeUIResources() {this.pijulSettingsComponent = null}} - file addition: PijulSettingsComponent.kt[0.3292]
package com.github.jonathanxd.dracon.componentimport com.github.jonathanxd.dracon.i18n.DraconBundleimport com.github.jonathanxd.dracon.util.findBinaryOrNullimport com.intellij.openapi.fileChooser.FileChooserDescriptorimport com.intellij.openapi.fileTypes.FileTypeRegistryimport com.intellij.openapi.ui.FixedSizeButtonimport com.intellij.openapi.ui.TextFieldWithBrowseButtonimport com.intellij.openapi.vfs.VirtualFileimport com.intellij.ui.components.JBCheckBoximport com.intellij.ui.components.JBLabelimport com.intellij.uiDesigner.core.Spacerimport com.intellij.util.ui.FormBuilderimport com.intellij.util.ui.UIUtilimport java.awt.BorderLayoutimport java.awt.event.MouseAdapterimport java.awt.event.MouseEventimport javax.swing.JButtonimport javax.swing.JComponentimport javax.swing.JPanelclass PijulSettingsComponent {val indexAllRevisions = JBCheckBox(DraconBundle.message("settings.dracon.index.all.text")).also {it.toolTipText = DraconBundle.message("settings.dracon.index.all.tooltip.text")}val pijulPath = TextFieldWithBrowseButton().also {it.addBrowseFolderListener(DraconBundle.message("settings.pijul.path.select.text"),"",null,FileChooserDescriptor(true, false, false, false, false, false).withFileFilter { file: VirtualFile? ->file?.name == "pijul"})}val detectPijul = JButton(DraconBundle.message("settings.pijul.path.detect.text")).also {it.addMouseListener(object : MouseAdapter() {override fun mouseClicked(e: MouseEvent) {pijulPath.text = findBinaryOrNull("pijul") ?: ""}})it.updateUI()}var mainPanel: JPanel =FormBuilder.createFormBuilder().addLabeledComponent(JBLabel(DraconBundle.message("settings.pijul.path.text")), pijulPath, 1, false).addComponent(JPanel(BorderLayout()).also {it.add(indexAllRevisions, BorderLayout.WEST)it.add(detectPijul, BorderLayout.EAST)}, 0).addComponentFillVertically(JPanel(), 0).panelval preferredFocusedComponent: JComponentget() = this.pijulPath} - edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 19
import com.github.jonathanxd.dracon.config.PijulSettings - edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 25
import com.github.jonathanxd.dracon.exec.execInTerminalimport com.github.jonathanxd.dracon.exec.terminalCommand - edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 56
import java.util.concurrent.CompletableFuture - edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 477
this.project,root,arguments,editorServerConsumer)return this.doExecutionWithMapper("push", operation) {it}}override fun pushInTerminal(project: Project,root: Path,fromChannel: String?,toChannel: String?,repository: String?,editorServerConsumer: (EditorServer) -> Unit): PijulOperationResult<String> {val arguments = mutableListOf("push")if (fromChannel != null) {arguments.add("--from-channel")arguments.add(fromChannel)}if (toChannel != null) {arguments.add("--to-channel")arguments.add(toChannel)}if (repository != null) {arguments.add(repository)}val operation = this.createPainlessExecPijulWithEditorServerInTerminal( - edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 1196
.directory(dir.toFile()).start()editorServerConsumer(EditorServer(freePort) {!process.isAlive})val input = String(process.inputStream.readAllBytes(), Charsets.UTF_8)val error = String(process.errorStream.readAllBytes(), Charsets.UTF_8)input.split("\n").forEach {draconConsoleWriter(project).logCommand("pijul", args, it)}error.split("\n").forEach {draconConsoleWriter(project).logCommandError("pijul", args, it)}val exit = process.waitFor()if (exit == 0) {draconConsoleWriter(project).logCommand("pijul", args, "<Exit status> $exit")} else {draconConsoleWriter(project).logCommandError("pijul", args, "<Exit status> $exit")}return PijulExecution(input,error,exit)}/*** Creates a [PijulExecution] operation that could be executed at any time. This operation uses Kotlin Coroutines* and can be executed immediately through [doExecution] or through [doExecutionWithMapper].** This implementation does not requires a delay value to be provided, like [createExecPijulOperation] does, instead* it uses the kotlin conversion from `CompletionStage` to `Coroutines` and awaits the process through [Process.onExit].** [doExecution] and [doExecutionWithMapper] does execution by scheduling task to [Dispatchers.IO], instead of Main Thread,* offloading the Process execution handling to a different scheduler. However, mapping operation of [doExecutionWithMapper]* is not offloaded from the caller context.**/@RequiresBackgroundThreadprivate fun createPainlessExecPijulWithEditorServerInTerminal(project: Project,dir: Path,args: List<String>,editorServerConsumer: (EditorServer) -> Unit): PijulExecution {val freePort = freePort()val cmd = listOf(this.findPijul()) + argsval terminalCmd = terminalCommand("command.execute.text", cmd.joinToString(" "))val process = ProcessBuilder().apply {environment()["EDITOR_SERVER_PORT"] = freePort.toString()environment()["VISUAL"] = editorServerPath()environment()["EDITOR"] = editorServerPath()}.command(terminalCmd) - replacement in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 1291
private fun findPijul(): String = findBinary("pijul")private fun findPijul(): String =service<PijulSettings>().getPathToPijul() ?: findBinary("pijul") - replacement in src/main/kotlin/com/github/jonathanxd/dracon/checkin/PijulCheckingEnvironment.kt at line 147
private val settings = project.service<PijulSettings>()private val settings = PijulSettings.instance - replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 58
project.service<PijulSettings>().isToCacheAllRevisions()PijulSettings.instance.isToCacheAllRevisions() - edit in src/main/kotlin/com/github/jonathanxd/dracon/activity/PijulPostStartupActivity.kt at line 3
import com.github.jonathanxd.dracon.exec.execInTerminal - replacement in src/main/kotlin/com/github/jonathanxd/dracon/activity/PijulPostStartupActivity.kt at line 177
this.execInTerminal("install.cargo.title", file.toString())execInTerminal("install.cargo.title", file.toString()) - replacement in src/main/kotlin/com/github/jonathanxd/dracon/activity/PijulPostStartupActivity.kt at line 179
this.execInTerminal("install.cargo.title", "sh $file")execInTerminal("install.cargo.title", "sh $file") - edit in src/main/kotlin/com/github/jonathanxd/dracon/activity/PijulPostStartupActivity.kt at line 189
fun execInTerminal(@PropertyKey(resourceBundle = BUNDLE) name: String,command: String) {ExecUtil.execAndGetOutput(GeneralCommandLine(ExecUtil.getTerminalCommand(DraconBundle.message(name), command)))} - replacement in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulPushRecord.kt at line 25
val record = pijul(project).push(project, root) {val record = pijul(project).pushInTerminal(project, root) { - file addition: Dracon-0.1.0-EXPERIMENTAL-BUILD-3.zip[20.26]