Add experimental build 3 and options

[?]
Apr 11, 2021, 3:14 AM
DLDMHQY6F53N2YXNDBQY77GAU2I4N2OWC3DL6L36T2SSAVW6YSXAC

Dependencies

  • [2] RE4EKNSL Improvements, a lot
  • [3] ISO7J5ZH More 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] 2N67RQZC Add auto installation support and cache content of ContentRevision
  • [5] 5AUENX2Y Add support to view files affected by a revision
  • [6] 6CR2EFUN First 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] A7IL6I3V More files to support .ignore
  • [9] OMZXJL6Q Ready for pijul push! First nightly build will be released shortly!
  • [10] Q35OTML2 Remove 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] FRFFQV7V Basic show history support.
  • [12] Q7FXTHVU First record support, YEAAAH, RECOOORD
  • [13] FNNW5IEA Added more plugin files to Pijul
  • [14] QXUEMZ3B Initial CahngeProvider
  • [15] 37OJKSWJ Improved caching code a lot
  • [*] GGYFPXND Initial plugin
  • [*] ZCRW57C5 Improved support for revisions
  • [*] OPFG6CZ2 File status tracking supported.
  • [*] MZYZIVHY First 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
    [3.9409]
    [3.10308]
    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
    [3.10309][3.10309:10364]()
    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=Detect
    settings.pijul.path.select.text=Select Pijul Binary
    settings.dracon.index.all.text=Index all revisions
    settings.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
    [2.311]
    [3.10566]
    <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
    [3.10567]
    [17.2303]
    <applicationService serviceImplementation="com.github.jonathanxd.dracon.config.PijulSettings"/>
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/push/PijulPusher.kt at line 33
    [3.14901]
    [3.14901]
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/push/PijulPusher.kt at line 35
    [3.14902][3.14902:14946]()
    val push = pijul(project).push(
    [3.14902]
    [3.14946]
    val push = pijul(project).pushInTerminal(
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/push/PijulOutgoingChangesProvider.kt at line 34
    [3.27965][3.27965:28056]()
    val r = pijul(project).push(project, ctx.root, fromChannel, toChannel, toRemote) {
    [3.27965]
    [3.28056]
    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
    [18.5788]
    [18.5788]
    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 (d--r------)
    [3.107]
    [2.12858]
  • file addition: exec (d--r------)
    [3.107]
  • file addition: Terminal.kt (----------)
    [0.1398]
    package com.github.jonathanxd.dracon.exec
    import com.github.jonathanxd.dracon.i18n.BUNDLE
    import com.github.jonathanxd.dracon.i18n.DraconBundle
    import com.intellij.execution.configurations.GeneralCommandLine
    import com.intellij.execution.process.ProcessOutput
    import com.intellij.execution.util.ExecUtil
    import org.jetbrains.annotations.PropertyKey
    import java.nio.file.Path
    fun 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
    [3.5431]
    [3.5431]
    import com.github.jonathanxd.dracon.util.findBinary
    import com.github.jonathanxd.dracon.util.findBinaryOrNull
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 11
    [3.5662][3.5662:5750]()
    @State(name = "Pijul.Settings", storages = [Storage(StoragePathMacros.WORKSPACE_FILE)])
    [3.5662]
    [3.5750]
    @State(name = "Pijul.Settings", storages = [Storage("DraconSettings.xml")])
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 13
    [3.5874]
    [3.5874]
    companion object {
    val instance get() = service<PijulSettings>()
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 31
    [2.13584]
    [3.6169]
    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
    [3.6603][3.6603:6633]()
    var pathToGit by string()
    [3.6603]
    [3.6633]
    var pathToPijul by string(defaultValue = findBinaryOrNull("pijul"))
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/config/PijulSettings.kt at line 60
    [2.13627][2.13627:13686]()
    var cacheAllRevisions by property(defaultValue = true)
    [2.13627]
    [2.13686]
    var cacheAllRevisions by property(defaultValue = false)
  • file addition: component (d--r------)
    [3.107]
  • file addition: PijulSettingsConfigurable.kt (----------)
    [0.3292]
    package com.github.jonathanxd.dracon.component
    import com.github.jonathanxd.dracon.config.PijulSettings
    import com.github.jonathanxd.dracon.i18n.DraconBundle
    import com.intellij.openapi.options.Configurable
    import javax.swing.JComponent
    class PijulSettingsConfigurable: Configurable {
    private var pijulSettingsComponent: PijulSettingsComponent? = null
    override fun createComponent(): JComponent =
    PijulSettingsComponent().let {
    this.pijulSettingsComponent = it
    it
    }.mainPanel
    override fun getPreferredFocusedComponent(): JComponent? =
    this.pijulSettingsComponent?.preferredFocusedComponent
    override fun isModified(): Boolean {
    val settings = PijulSettings.instance
    val pathToPijul = settings.getPathToPijul()
    val cacheAllRevisions = settings.isToCacheAllRevisions()
    var modified = this.pijulSettingsComponent?.pijulPath?.text != pathToPijul
    modified = modified || (this.pijulSettingsComponent?.indexAllRevisions?.isSelected == cacheAllRevisions)
    return modified
    }
    override fun apply() {
    val settings = PijulSettings.instance
    settings.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.instance
    this.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.component
    import com.github.jonathanxd.dracon.i18n.DraconBundle
    import com.github.jonathanxd.dracon.util.findBinaryOrNull
    import com.intellij.openapi.fileChooser.FileChooserDescriptor
    import com.intellij.openapi.fileTypes.FileTypeRegistry
    import com.intellij.openapi.ui.FixedSizeButton
    import com.intellij.openapi.ui.TextFieldWithBrowseButton
    import com.intellij.openapi.vfs.VirtualFile
    import com.intellij.ui.components.JBCheckBox
    import com.intellij.ui.components.JBLabel
    import com.intellij.uiDesigner.core.Spacer
    import com.intellij.util.ui.FormBuilder
    import com.intellij.util.ui.UIUtil
    import java.awt.BorderLayout
    import java.awt.event.MouseAdapter
    import java.awt.event.MouseEvent
    import javax.swing.JButton
    import javax.swing.JComponent
    import javax.swing.JPanel
    class 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)
    .panel
    val preferredFocusedComponent: JComponent
    get() = this.pijulPath
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 19
    [3.15130]
    [3.41053]
    import com.github.jonathanxd.dracon.config.PijulSettings
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 25
    [3.8223]
    [3.15130]
    import com.github.jonathanxd.dracon.exec.execInTerminal
    import com.github.jonathanxd.dracon.exec.terminalCommand
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 56
    [18.6496]
    [19.2836]
    import java.util.concurrent.CompletableFuture
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 477
    [3.44323]
    [3.44323]
    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
    [3.10352]
    [3.10352]
    .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.
    *
    */
    @RequiresBackgroundThread
    private fun createPainlessExecPijulWithEditorServerInTerminal(
    project: Project,
    dir: Path,
    args: List<String>,
    editorServerConsumer: (EditorServer) -> Unit
    ): PijulExecution {
    val freePort = freePort()
    val cmd = listOf(this.findPijul()) + args
    val 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
    [3.17737][3.11347:11405]()
    private fun findPijul(): String = findBinary("pijul")
    [3.17737]
    [3.18067]
    private fun findPijul(): String =
    service<PijulSettings>().getPathToPijul() ?: findBinary("pijul")
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/checkin/PijulCheckingEnvironment.kt at line 147
    [3.13356][3.13356:13420]()
    private val settings = project.service<PijulSettings>()
    [3.13356]
    [3.13420]
    private val settings = PijulSettings.instance
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 58
    [2.15934][2.15934:16015]()
    project.service<PijulSettings>().isToCacheAllRevisions()
    [2.15934]
    [2.16015]
    PijulSettings.instance.isToCacheAllRevisions()
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/activity/PijulPostStartupActivity.kt at line 3
    [3.3718]
    [3.3718]
    import com.github.jonathanxd.dracon.exec.execInTerminal
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/activity/PijulPostStartupActivity.kt at line 177
    [3.10584][3.10584:10672]()
    this.execInTerminal("install.cargo.title", file.toString())
    [3.10584]
    [3.10672]
    execInTerminal("install.cargo.title", file.toString())
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/activity/PijulPostStartupActivity.kt at line 179
    [3.10705][3.10705:10788]()
    this.execInTerminal("install.cargo.title", "sh $file")
    [3.10705]
    [3.10788]
    execInTerminal("install.cargo.title", "sh $file")
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/activity/PijulPostStartupActivity.kt at line 189
    [3.11043][3.11043:11287]()
    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
    [3.52850][3.52850:52908]()
    val record = pijul(project).push(project, root) {
    [3.52850]
    [3.52908]
    val record = pijul(project).pushInTerminal(project, root) {
  • file addition: Dracon-0.1.0-EXPERIMENTAL-BUILD-3.zip (----------)
    [20.26]