Improved caching code a lot

[?]
Apr 4, 2021, 12:07 PM
37OJKSWJFDRHNWQW6P7HSZX6OWZWVNCJ2IFT42O5TANQF7VOVX6AC

Dependencies

  • [2] A7JOR7M3 Fixed the link and added a better description for download the .zip
  • [3] G54TB4QZ typo fix
  • [4] 2N67RQZC Add auto installation support and cache content of ContentRevision
  • [5] 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.
  • [6] 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).
  • [7] GGYFPXND Initial plugin
  • [8] MTPTFTHG Initial plugin 2
  • [9] PGNTR2EP Improved README and ider roadmap
  • [10] FNNW5IEA Added more plugin files to Pijul
  • [11] Q7FXTHVU First record support, YEAAAH, RECOOORD
  • [12] ZCRW57C5 Improved support for revisions
  • [13] OPFG6CZ2 File status tracking supported.
  • [14] 7L5LODGZ Parse changes from `pijul change`
  • [15] 6CR2EFUN First ChangeProvider implementation!!! Wheehooo
  • [16] MZYZIVHY First experimental build, it seems like it is breaking Git plugin, however, it still something =D
  • [17] EAGIDXOL Build 2 to only listen to changes in project under pijul
  • [18] 5AUENX2Y Add support to view files affected by a revision
  • [19] QXUEMZ3B Initial CahngeProvider
  • [20] 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.
  • [21] NTRPUMVQ Improved README and added roadmap.
  • [22] MJDBCNFH Moved builds to builds dir
  • [23] FRFFQV7V Basic show history support.

Change contents

  • replacement in src/test/kotlin/com/github/jonathanxd/dracon/test/DraconTest.kt at line 434
    [5.28513][5.28513:28538]()
    println(sources)
    [5.28513]
    [5.28538]
  • file addition: DraconCreditTest.kt (----------)
    [5.11189]
    package com.github.jonathanxd.dracon.test
    import com.github.jonathanxd.dracon.log.*
    import com.github.jonathanxd.dracon.pijul.credit.parseCredit
    import io.kotest.core.spec.style.ShouldSpec
    import io.kotest.matchers.shouldBe
    import java.time.ZoneOffset
    import java.time.ZonedDateTime
    class DraconCreditTest : ShouldSpec({
    should("correctly parse a 'pijul credit' text with example credit") {
    val text = """
    GGYFPXND4VBCQ
    NTRPUMVQHUIQY
    > #
    > # Dracon - An IntelliJ-Pijul integration.
    > # Copyright 2021 JonathanxD <jhrldev@gmail.com>
    > #
    > # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    > #
    > # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    > #
    > # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    > #
    >
    GGYFPXND4VBCQ, NTRPUMVQHUIQY
    > dracon.vcs.name=Pijul
    > dracon.vcs.name.with.mnemonic=_Pijul
    Q7FXTHVUPVAFM
    >
    GGYFPXND4VBCQ, Q7FXTHVUPVAFM
    >
    MTPTFTHGAOKQG
    > action.Pijul.Init.text=Create Pijul Repository
    > action.Pijul.Add.text=Add Files...
    ZCRW57C5MSBXY
    > action.Pijul.ExpertRecord.text=Record (Expert Mode)...
    2N67RQZCVGL6G
    > action.Pijul.InvalidateCaches.text=Invalidate Caches
    ZCRW57C5MSBXY, 2N67RQZCVGL6G, MTPTFTHGAOKQG
    > action.Pijul.Commit.And.Push.text=Commit And Push...
    GGYFPXND4VBCQ, MTPTFTHGAOKQG
    > init.title=Create Pijul Repository
    > init.description=Select the target directory to init Pijul repository.
    > init.warning.title=Pijul Init
    > init.warning.already.under.pijul=The directory <tt>{0}</tt> is already under Pijul.\n\
    Q7FXTHVUPVAFM, MTPTFTHGAOKQG
    > Are you sure that you want to create a new VCS root?
    > init.error=Failed to initialize Pijul repository.
    >
    > dracon.refresh=Refreshing Pijul Repository
    >
    ZCRW57C5MSBXY, Q7FXTHVUPVAFM
    > group.Pijul.Menu.text=_Pijul
    >
    > record.action.name=Record
    ZCRW57C5MSBXY, 2N67RQZCVGL6G
    > record.author=&Author:
    > record.expert.mode.title=Record (Expert Mode)
    >
    > expert.mode.button.record=Record
    > expert.mode.button.cancel=Cancel
    >
    > expert.mode.notification.group.id=Expert mode
    > expert.mode.notification.title=Record (expert mode)
    > expert.mode.notification.success=Successfully recorded changes. New revision: <tt>{0}</tt>.
    2N67RQZCVGL6G
    > expert.mode.notification.failure=Failed to record changes with exit code <bold>{0}</bold> and message: <tt>{1}</tt>.
    >
    > cache.invalidate.text=Invalidating caches...
    > cache.invalidate.current.text=Invalidating <em>{0}</em>...
    > cache.invalidate.finish.text=Invalidated caches
    >
    > install.pijul.title=Install pijul
    > install.pijul.title2=Install Pijul
    > install.pijul.text=Cannot find pijul binaries.\n\
    > Do you want to install pijul using rust cargo?
    >
    > install.editor.server.title=Install editor-server
    > install.editor.server.title2=Install Editor Server
    > install.editor.server.text=Cannot find editor-server binaries.\n\
    > Dracon depends on editor-server for interfacing with Pijul.\n\
    > Do you want to install editor-server using rust cargo?
    >
    > install.cargo.title=Install Rustup and Cargo
    > install.cargo.text=In order to install <tt>{0}</tt> you need to have cargo installed.\n\
    > However we cannot find cargo installed in this machine.\n\
    > Do you want to install rustup with cargo?\n\
    > If you agree, we will download rustup and launch the installer, you take from there.
    >
    > install.pijul.warning.text=You won't be able to use Dracon plugin since some dependencies could not be installed.
    >
    > install.cargo.running.text=Running cargo install...
    """.trimIndent()
    val credit = text.parseCredit()
    credit.toString() shouldBe "PijulCredit(header=[GGYFPXND4VBCQ], entries=[PijulCreditEntry(shortHash=[NTRPUMVQHUIQY], data=[#, # Dracon - An IntelliJ-Pijul integration., # Copyright 2021 JonathanxD <jhrldev@gmail.com>, #, # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, #, # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., #, # THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., #, ]), PijulCreditEntry(shortHash=[GGYFPXND4VBCQ, NTRPUMVQHUIQY], data=[dracon.vcs.name=Pijul, dracon.vcs.name.with.mnemonic=_Pijul]), PijulCreditEntry(shortHash=[Q7FXTHVUPVAFM], data=[]), PijulCreditEntry(shortHash=[GGYFPXND4VBCQ, Q7FXTHVUPVAFM], data=[]), PijulCreditEntry(shortHash=[MTPTFTHGAOKQG], data=[action.Pijul.Init.text=Create Pijul Repository, action.Pijul.Add.text=Add Files...]), PijulCreditEntry(shortHash=[ZCRW57C5MSBXY], data=[action.Pijul.ExpertRecord.text=Record (Expert Mode)...]), PijulCreditEntry(shortHash=[2N67RQZCVGL6G], data=[action.Pijul.InvalidateCaches.text=Invalidate Caches]), PijulCreditEntry(shortHash=[ZCRW57C5MSBXY, 2N67RQZCVGL6G, MTPTFTHGAOKQG], data=[action.Pijul.Commit.And.Push.text=Commit And Push...]), PijulCreditEntry(shortHash=[GGYFPXND4VBCQ, MTPTFTHGAOKQG], data=[init.title=Create Pijul Repository, init.description=Select the target directory to init Pijul repository., init.warning.title=Pijul Init, init.warning.already.under.pijul=The directory <tt>{0}</tt> is already under Pijul.\\n\\]), PijulCreditEntry(shortHash=[Q7FXTHVUPVAFM, MTPTFTHGAOKQG], data=[ Are you sure that you want to create a new VCS root?, init.error=Failed to initialize Pijul repository., , dracon.refresh=Refreshing Pijul Repository, ]), PijulCreditEntry(shortHash=[ZCRW57C5MSBXY, Q7FXTHVUPVAFM], data=[group.Pijul.Menu.text=_Pijul, , record.action.name=Record]), PijulCreditEntry(shortHash=[ZCRW57C5MSBXY, 2N67RQZCVGL6G], data=[record.author=&Author:, record.expert.mode.title=Record (Expert Mode), , expert.mode.button.record=Record, expert.mode.button.cancel=Cancel, , expert.mode.notification.group.id=Expert mode, expert.mode.notification.title=Record (expert mode), expert.mode.notification.success=Successfully recorded changes. New revision: <tt>{0}</tt>.]), PijulCreditEntry(shortHash=[2N67RQZCVGL6G], data=[expert.mode.notification.failure=Failed to record changes with exit code <bold>{0}</bold> and message: <tt>{1}</tt>., , cache.invalidate.text=Invalidating caches..., cache.invalidate.current.text=Invalidating <em>{0}</em>..., cache.invalidate.finish.text=Invalidated caches, , install.pijul.title=Install pijul, install.pijul.title2=Install Pijul, install.pijul.text=Cannot find pijul binaries.\\n\\, Do you want to install pijul using rust cargo?, , install.editor.server.title=Install editor-server, install.editor.server.title2=Install Editor Server, install.editor.server.text=Cannot find editor-server binaries.\\n\\, Dracon depends on editor-server for interfacing with Pijul.\\n\\, Do you want to install editor-server using rust cargo?, , install.cargo.title=Install Rustup and Cargo, install.cargo.text=In order to install <tt>{0}</tt> you need to have cargo installed.\\n\\, However we cannot find cargo installed in this machine.\\n\\, Do you want to install rustup with cargo?\\n\\, If you agree, we will download rustup and launch the installer, you take from there., , install.pijul.warning.text=You won't be able to use Dracon plugin since some dependencies could not be installed., , install.cargo.running.text=Running cargo install...])])"
    }
    })
  • edit in src/main/resources/messages/DraconBundle.properties at line 20
    [4.53]
    [5.82]
    action.Pijul.AddToIgnore.text=Add To .ignore
  • edit in src/main/resources/messages/DraconBundle.properties at line 67
    [4.1228]
    [4.1228]
    install.cargo.running.text=Running cargo install...
  • replacement in src/main/resources/messages/DraconBundle.properties at line 70
    [4.1229][4.1229:1280]()
    install.cargo.running.text=Running cargo install...
    [4.1229]
    index.revision.text=Indexing files revisions.
    index.reset.text=Resetting working directory...
    index.item.description.text=Indexing <tt>{0}</tt>...
    index.item.description.finish.text=Finished!
    index.unrecord.description.text=Un-recording changes...
    index.ls.text=Listing tracked files...
    index.revision.loading.text=Loading revisions...
    index.revision.files.text=Working on files...
    index.revision.description.text=Working on revision {0}...
    index.revision.file.description.text=Loading file {0} of revision {1}...
  • edit in src/main/resources/META-INF/plugin.xml at line 30
    [5.964]
    [5.540]
    <vcsIgnoreChecker implementation="com.github.jonathanxd.dracon.ignore.PijulIgnoreChecker"/>
  • edit in src/main/resources/META-INF/plugin.xml at line 34
    [4.1392]
    [5.2261]
    <backgroundPostStartupActivity implementation="com.github.jonathanxd.dracon.activity.PijulIndexActivity"/>
  • edit in src/main/resources/META-INF/plugin.xml at line 36
    [5.2303]
    [5.2303]
    <!-- Pijul ignore lang -->
    <fileType language="PijulIgnore" extensions="ignore" fieldName="INSTANCE" name="PijulIgnore file"
    implementationClass="com.github.jonathanxd.dracon.lang.ignore.PijulIgnoreFileType"/>
    <lang.parserDefinition language="PijulIgnore"
    implementationClass="com.intellij.openapi.vcs.changes.ignore.lang.IgnoreParserDefinition"/>
    <codeInsight.lineMarkerProvider language="PijulIgnore"
    implementationClass="com.intellij.openapi.vcs.changes.ignore.codeInsight.IgnoreDirectoryMarkerProvider"/>
    <lang.braceMatcher language="PijulIgnore" implementationClass="com.intellij.openapi.vcs.changes.ignore.lang.IgnoreBraceMatcher"/>
    <lang.commenter language="PijulIgnore" implementationClass="com.intellij.openapi.vcs.changes.ignore.lang.IgnoreCommenter"/>
    <!--END Pijul ignore lang-->
  • replacement in src/main/resources/META-INF/plugin.xml at line 59
    [4.1412][4.1412:1524](),[4.1524][5.1228:1246](),[5.1228][5.1228:1246]()
    <action id="Pijul.InvalidateCaches" class="com.github.jonathanxd.dracon.actions.PijulInvalidateCaches">
    </action>
    [4.1412]
    [5.681]
    <action id="Pijul.InvalidateCaches" class="com.github.jonathanxd.dracon.actions.PijulInvalidateCaches"/>
    <action id="Pijul.AddToIgnore" class="com.github.jonathanxd.dracon.actions.PijulAddToIgnore"/>
  • edit in src/main/resources/META-INF/plugin.xml at line 90
    [5.2349]
    [5.2350]
    </group>
    <group id="Pijul.Ignore.File" class="com.github.jonathanxd.dracon.actions.PijulIgnoreActionGroup">
    <add-to-group group-id="ChangesViewPopupMenu" anchor="after" relative-to-action="ChangesView.AddUnversioned"/>
    <add-to-group group-id="Pijul.Menu" anchor="after" relative-to-action="Pijul.Add"/>
    <add-to-group group-id="Unversioned.Files.Dialog.Popup" anchor="after" relative-to-action="$Delete"/>
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 3
    [5.656]
    [5.2549]
    import com.github.jonathanxd.dracon.i18n.DraconBundle
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 6
    [5.704]
    [5.704]
    import com.intellij.openapi.progress.ProgressIndicator
    import com.intellij.openapi.progress.forEachWithProgress
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 15
    [5.954][5.954:982]()
    import java.util.Comparator
    [5.954]
    [5.982]
    import java.util.*
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 54
    [5.439][5.1690:1770]()
    val tempDir = FileUtilRt.createTempDirectory("dracon_diffs-", revisionHash)
    [5.439]
    [5.1770]
    if (Files.isDirectory(filePath)) {
    // Will always fail for directories.
    return ""
    }
    val tempDir = FileUtilRt.createTempDirectory("dracon_diffs-", revisionHash + UUID.randomUUID().toString())
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 85
    [5.1963]
    [5.1963]
    } finally {
    FileUtilRt.delete(tempDir)
    }
    }
    @OptIn(ExperimentalPathApi::class)
    fun loadStateInRevisionForAllFiles(revisionHash: String,
    project: Project,
    root: Path,
    i: ProgressIndicator): Map<Path, ByteArray> {
    val tempDir = FileUtilRt.createTempDirectory("dracon_diffs-all-", revisionHash + UUID.randomUUID().toString())
    val tmpTarget = tempDir.toPath()
    val pathToRevisionState = mutableMapOf<Path, ByteArray>()
    copyFolder(root, tmpTarget, StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING)
    val revisions = pijul(project).latestRevisionNumber(project, tmpTarget).result
    i.text2 = DraconBundle.message("index.reset.text")
    val reset = pijul(project).reset(project, tmpTarget)
    if (reset.statusCode !is SuccessStatusCode) {
    throw IllegalStateException("Failed to load state of all files in revision $revisionHash during reset. $revisions")
    }
    i.fraction += 0.0001
    if (revisions == null || revisions.hash != revisionHash) {
    i.text2 = DraconBundle.message("index.unrecord.description.text")
    val rollbackOp = pijul(project).rollbackTo(revisionHash, project, tmpTarget)
    if (rollbackOp.statusCode !is SuccessStatusCode) {
    throw IllegalStateException("Failed to load state of all files in revision $revisionHash during unrecord. $rollbackOp")
    }
    i.fraction += 0.0001
    }
    i.text2 = DraconBundle.message("index.ls.text")
    val ls = pijul(project).trackedFiles(project, tmpTarget)
    if (ls.statusCode !is SuccessStatusCode) {
    throw IllegalStateException("Failed to load state of all files in revision $revisionHash during reset. $revisions")
    }
    i.fraction += 0.0001
    val trackedFiles = ls.result!!
    trackedFiles.forEachWithProgress(i) { it, indic ->
    indic.text2 = DraconBundle.message("index.item.description.text", it.toString())
    if (Files.isRegularFile(it)) {
    pathToRevisionState[it] = Files.readAllBytes(it)
    }
    }
    i.text2 = DraconBundle.message("index.item.description.finish.text")
    try {
    return pathToRevisionState
    } finally {
    FileUtilRt.delete(tempDir)
    }
    }
    @OptIn(ExperimentalPathApi::class)
    fun loadStateInEveryRevisionForAllFiles(allRevisions: List<String>,
    project: Project,
    root: Path,
    i: ProgressIndicator): Map<String, Map<Path, ByteArray>> {
    if (allRevisions.isEmpty()) {
    throw IllegalArgumentException("Provided 'allRevisions' argument must not be empty.")
    }
    val tempDir = FileUtilRt.createTempDirectory("dracon_diffs-all-","${allRevisions.size}-" + UUID.randomUUID().toString())
    val tmpTarget = tempDir.toPath()
    val revisionToPathToState = mutableMapOf<String, MutableMap<Path, ByteArray>>()
    copyFolder(root, tmpTarget, StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING)
    val revisions = pijul(project).allRevisions(project, tmpTarget)
    if (revisions.statusCode !is SuccessStatusCode) {
    throw IllegalStateException("Failed to load state of all files in revisions '$allRevisions' during all revisions hash retrieval. $revisions")
    }
    val pijulRevisions = revisions.result!!.map { it.hash }
    val indexOfFirstRevision = pijulRevisions.indexOf(allRevisions[0])
    if (indexOfFirstRevision == -1) {
    throw IllegalArgumentException("Could not find revision ${allRevisions[0]} in Pijul repository!")
    } else {
    if (indexOfFirstRevision + allRevisions.size >= pijulRevisions.size) {
    throw IllegalArgumentException("There are more revisions to unrecord than the amount of recorded changes in Pijul Repository.")
    } else {
    val revisionSubList = pijulRevisions.subList(indexOfFirstRevision, indexOfFirstRevision + allRevisions.size)
    if (allRevisions != revisionSubList) {
    throw IllegalArgumentException("Revisions to load must sequentially match a sub sequence of revisions in Pijul repository. " +
    "Changes found in pijul: $revisionSubList. Changes to unrecord: $allRevisions")
    }
    }
    }
    i.text2 = DraconBundle.message("index.reset.text")
    val reset = pijul(project).reset(project, tmpTarget)
    if (reset.statusCode !is SuccessStatusCode) {
    throw IllegalStateException("Failed to load state of all files in revisions '$allRevisions' during reset. $reset")
    }
    i.fraction += 0.0001
    allRevisions.withIndex().toList().forEachWithProgress(i) { (index, rev), indicator ->
    val pathToRevisionState = revisionToPathToState.computeIfAbsent(rev) { mutableMapOf() }
    indicator.text2 = DraconBundle.message("index.revision.description.text", rev)
    if (index == 0) {
    val rollback = pijul(project).rollbackTo(rev, project, tmpTarget)
    if (rollback.statusCode !is SuccessStatusCode) {
    throw IllegalStateException("Failed to load state of all files in revision '$rev' during rollback. $rollback")
    }
    } else {
    val unrecord = pijul(project).unrecord(project, tmpTarget, rev)
    if (unrecord.statusCode !is SuccessStatusCode) {
    throw IllegalStateException("Failed to load state of all files in revision '$rev' during unrecord. $unrecord")
    }
    }
    indicator.text2 = DraconBundle.message("index.ls.text")
    val ls = pijul(project).trackedFiles(project, tmpTarget)
    if (ls.statusCode !is SuccessStatusCode) {
    throw IllegalStateException("Failed to load state of all files in revision $rev during tracked file listing. $ls")
    }
    indicator.fraction += 0.0001
    val trackedFiles = ls.result!!
    trackedFiles.forEachWithProgress(indicator) { it, indic ->
    indic.text2 = DraconBundle.message("index.item.description.text", it.toString())
    if (Files.isRegularFile(it)) {
    val relativeToRoot = root.resolve(it.relativeTo(tmpTarget))
    pathToRevisionState[relativeToRoot] = Files.readAllBytes(it)
    }
    }
    }
    i.text2 = DraconBundle.message("index.item.description.finish.text")
    try {
    return revisionToPathToState
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 247
    [5.1336]
    [5.2251]
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 26
    [5.3477]
    [5.442]
    import java.nio.file.Files
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 29
    [5.5283]
    [5.5283]
    import kotlin.io.path.ExperimentalPathApi
    import kotlin.io.path.name
    import kotlin.io.path.relativeTo
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 103
    [5.1291]
    [5.6970]
    @OptIn(ExperimentalPathApi::class)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 121
    [5.7565][5.2796:2877]()
    val deleted = it.hunks.filterIsInstance<HunkWithPath>().filter {
    [5.7565]
    [5.2877]
    /*val deleted = it.hunks.filterIsInstance<HunkWithPath>().filter {
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 136
    [5.3510][5.3510:3654]()
    )
    /*// TODO: Should we limit to show only one revision when introspecting directories instead of all revisions?
    [5.3510]
    [5.3657]
    )*/
    // TODO: Should we limit to show only one revision when introspecting directories instead of all revisions?
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 142
    [5.3887]
    [5.3887]
    if (!Files.isDirectory(path)) {
    val msg = if (Files.isDirectory(pathToView)) {
    "File ${path.name}"
    } else {
    it.message.replace("\n", " ").trim()
    }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 149
    [5.3888][5.3888:4416]()
    partner.acceptRevision(
    PijulVcsFileRevision(
    this.project,
    root.toNioPath(),
    path,
    PijulRevisionNumber(it.changeHash, it.date),
    it.authors.map { VcsUserImpl(it.name ?: "", it.email ?: "") }.filter { it.name.isNotEmpty() },
    it.message,
    currentChannel,
    deleted
    [5.3888]
    [5.4416]
    partner.acceptRevision(
    PijulVcsFileRevision(
    this.project,
    root.toNioPath(),
    path,
    PijulRevisionNumber(it.changeHash, it.date),
    it.authors.map { VcsUserImpl(it.name ?: "", it.email ?: "") }.filter { it.name.isNotEmpty() },
    msg,
    currentChannel,
    deleted
    )
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 161
    [5.4442][5.7967:7989](),[5.7967][5.7967:7989](),[5.7989][5.3655:3675]()
    )
    }*/
    [5.4442]
    [5.4461]
    }
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 4
    [5.3764]
    [5.119]
    import com.github.jonathanxd.dracon.cache.PijulLogRevisionCache
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 24
    [5.3896]
    [5.3896]
    private val logRevisionCache = project.service<PijulLogRevisionCache>()
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 56
    [5.1179][5.3947:4024]()
    val head = this.logEntryChangeCache.loadRevision(rootAbsolute) {
    [5.1179]
    [5.4024]
    val head = this.logRevisionCache.loadRevision(rootAbsolute) {
  • file addition: credit (----------)
    [5.3420]
  • file addition: PijulCredit.kt (----------)
    [0.19694]
    package com.github.jonathanxd.dracon.pijul.credit
    import com.github.jonathanxd.dracon.log.substringUntil
    import java.io.Serializable
    data class PijulCredit(val header: List<String>,
    val entries: List<PijulCreditEntry>
    ): Serializable {
    companion object {
    const val serialVersionUID = 1L
    }
    }
    data class PijulCreditEntry(val shortHash: List<String>, val data: List<String>): Serializable {
    companion object {
    const val serialVersionUID = 1L
    }
    }
    fun String.parseCredit(): PijulCredit {
    val header = mutableListOf<String>()
    val lines = mutableListOf<PijulCreditEntry>()
    var shortHashes: List<String>? = null
    var pointer = 0
    while (pointer > -1) {
    if (pointer < this.length && this[pointer] == '\n') {
    pointer += 1
    continue
    }
    if (pointer == this.length) {
    break
    }
    val line = this.substringUntil(pointer, '\n', includeChar = false)
    if (line.isNotEmpty() && line.isNotBlank()) {
    if (!line.startsWith(">")) {
    if (shortHashes != null) {
    header.addAll(shortHashes)
    }
    shortHashes = line.split(",").map { it.trim() }
    } else {
    val hashes = shortHashes
    ?: throw IllegalStateException("Something wrong happened during credit parsing")
    val data = mutableListOf<String>()
    var dataLine = line
    while (dataLine.startsWith("> ") && pointer > -1) {
    data.add(dataLine.substring("> ".length))
    if (pointer + 1 >= this.length) {
    break;
    }
    pointer = this.indexOf("\n", pointer + 1)
    if (pointer == -1) {
    break
    }
    while (pointer < this.length && this[pointer] == '\n') {
    pointer += 1
    if (pointer == this.length) {
    break
    }
    }
    dataLine = this.substringUntil(pointer, '\n', includeChar = false)
    }
    shortHashes = null
    lines += PijulCreditEntry(hashes, data)
    if (!dataLine.startsWith("> ") && line.isNotEmpty() && line.isNotBlank()) {
    shortHashes = dataLine.split(",").map { it.trim() }
    }
    }
    }
    if (pointer == -1) {
    break
    }
    if (pointer + 1 >= this.length) {
    break;
    }
    pointer = this.indexOf("\n", pointer + 1)
    }
    if (shortHashes != null) {
    header.addAll(shortHashes)
    }
    return PijulCredit(header, lines)
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/pijul/Pijul.kt at line 17
    [5.4514]
    [5.1633]
    import com.github.jonathanxd.dracon.pijul.credit.PijulCredit
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/pijul/Pijul.kt at line 90
    [5.4743]
    [5.4743]
    fun trackedFiles(project: Project, root: Path): PijulOperationResult<List<Path>>
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/pijul/Pijul.kt at line 106
    [5.4671]
    [5.4671]
    fun unrecord(project: Project, root: Path, hash: String): PijulOperationResult<Boolean>
    @RequiresBackgroundThread
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/pijul/Pijul.kt at line 176
    [5.4997]
    [5.6839]
    /**
    * Retrieves change history
    */
    @RequiresBackgroundThread
    fun credit(project: Project, root: Path, file: Path): PijulOperationResult<PijulCredit>
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/listeners/PijulAsyncFileListener.kt at line 5
    [5.7311]
    [5.7311]
    import com.github.jonathanxd.dracon.cache.PijulLogRevisionCache
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/listeners/PijulAsyncFileListener.kt at line 21
    [5.8092]
    [5.8092]
    private val pijulLogRevisionCache by lazy { this.project.service<PijulLogRevisionCache>() }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/listeners/PijulAsyncFileListener.kt at line 38
    [5.8664]
    [5.8664]
    this.pijulLogRevisionCache.unload(Paths.get(VcsUtil.getFilePath(file).path))
  • file addition: lang (----------)
    [5.107]
  • file addition: ignore (----------)
    [0.23277]
  • file addition: PijulIgnoreLanguage.kt (----------)
    [0.23287]
    package com.github.jonathanxd.dracon.lang.ignore
    import com.intellij.openapi.vcs.changes.ignore.lang.IgnoreFileType
    import com.intellij.openapi.vcs.changes.ignore.lang.IgnoreLanguage
    import com.intellij.openapi.vcs.changes.ignore.lang.Syntax
    object PijulIgnoreLanguage : IgnoreLanguage("PijulIgnore", "ignore") {
    override fun getFileType(): IgnoreFileType = PijulIgnoreFileType
    override fun isSyntaxSupported(): Boolean = true
    override fun getDefaultSyntax(): Syntax = Syntax.REGEXP
    }
  • file addition: PijulIgnoreFileType.kt (----------)
    [0.23287]
    package com.github.jonathanxd.dracon.lang.ignore
    import com.intellij.openapi.vcs.changes.ignore.lang.IgnoreFileType
    object PijulIgnoreFileType : IgnoreFileType(PijulIgnoreLanguage)
  • file addition: ignore (----------)
    [5.107]
  • file addition: PijulIgnoreChecker.kt (----------)
    [0.24032]
    package com.github.jonathanxd.dracon.ignore
    import com.github.jonathanxd.dracon.PijulVcs
    import com.intellij.openapi.vcs.IgnoredCheckResult
    import com.intellij.openapi.vcs.VcsIgnoreChecker
    import com.intellij.openapi.vcs.VcsKey
    import com.intellij.openapi.vfs.VirtualFile
    import java.nio.file.Path
    class PijulIgnoreChecker : VcsIgnoreChecker {
    override fun getSupportedVcs(): VcsKey = PijulVcs.KEY
    override fun isIgnored(vcsRoot: VirtualFile, file: Path): IgnoredCheckResult {
    TODO("Not yet implemented")
    }
    override fun isFilePatternIgnored(vcsRoot: VirtualFile, filePattern: String): IgnoredCheckResult {
    TODO("Not yet implemented")
    }
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 24
    [5.11119]
    [5.2655]
    import com.github.jonathanxd.dracon.pijul.credit.PijulCredit
    import com.github.jonathanxd.dracon.pijul.credit.parseCredit
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 88
    [5.13085][5.15467:15576]()
    val execution = this.createExecPijulOperation(project, path, listOf("add", "-r") + pathList)
    [5.13085]
    [5.13179]
    val execution = if (pathList.all { Files.isRegularFile(path.resolve(it)) }) {
    this.createExecPijulOperation(project, path, listOf("add") + pathList)
    } else {
    this.createExecPijulOperation(project, path, listOf("add", "-r") + pathList)
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 198
    [5.11236]
    [5.11236]
    @OptIn(ExperimentalPathApi::class)
    override fun credit(project: Project, root: Path, file: Path): PijulOperationResult<PijulCredit> {
    val filePath = file.relativeTo(root).toString()
    val credit = this.doExecutionWithMapper("credit",
    this.createExecPijulOperation(project, root, listOf("credit", filePath))
    ) {
    if (it.isEmpty() || it.trim().isEmpty() || it.trim().isBlank()) null
    else it.parseCredit()
    }
    return credit
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 250
    [5.9154]
    [5.9154]
    override fun trackedFiles(project: Project, root: Path): PijulOperationResult<List<Path>> {
    return this.doExecutionWithMapper("tracked_files_from_ls", this.createExecPijulOperation(project, root, listOf("ls"), log = false)) {
    it.split("\n").map {
    root.resolve(it)
    }
    }
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 296
    [5.3734]
    [5.7041]
    }
    }
    override fun unrecord(project: Project, root: Path, hash: String): PijulOperationResult<Boolean> {
    val unrecord = this.doExecution(
    "unrecord_$hash",
    this.createPainlessExecPijulOperation(project, root, listOf("unrecord", "--reset", hash))
    )
    if (unrecord.statusCode !is SuccessStatusCode) {
    return unrecord as PijulOperationResult<Boolean>
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 308
    [5.7051]
    [5.7051]
    val reset = this.reset(project, root)
    if (reset.statusCode !is SuccessStatusCode) {
    return reset
    }
    return PijulOperationResult("unrecord_${hash}", SuccessStatusCode, true)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 698
    [5.4472][5.4472:4582]()
    PijulOperationResult(name, NonZeroExitStatusCode(status, error), Unit) as PijulOperationResult<T>
    [5.4472]
    [5.9267]
    PijulOperationResult(name, NonZeroExitStatusCode(status, error), null) as PijulOperationResult<T>
  • file addition: PijulLogRevisionCache.kt (----------)
    [5.8571]
    package com.github.jonathanxd.dracon.cache
    import com.github.jonathanxd.dracon.context.PijulVcsContext
    import com.github.jonathanxd.dracon.log.PijulLogEntry
    import com.github.jonathanxd.dracon.pijul.PijulOperationResult
    import com.github.jonathanxd.dracon.pijul.SuccessStatusCode
    import com.github.jonathanxd.dracon.revision.PijulRevisionNumber
    import com.intellij.openapi.components.Service
    import com.intellij.openapi.components.service
    import com.intellij.openapi.project.Project
    import java.nio.file.Path
    import kotlin.io.path.ExperimentalPathApi
    import kotlin.io.path.relativeTo
    @Suppress("UnstableApiUsage")
    @OptIn(ExperimentalPathApi::class)
    @Service
    class PijulLogRevisionCache(val project: Project): CacheService<String, PijulRevisionNumber> {
    override val cache = DataCache<String, PijulRevisionNumber>(project, "revision")
    fun loadRevision(path: Path, compute: () -> PijulOperationResult<PijulRevisionNumber>): PijulOperationResult<PijulRevisionNumber> {
    val ctx = this.project.service<PijulVcsContext>()
    val relativePath = path.relativeTo(ctx.root).toString()
    return this.cache.queryOrLoad(relativePath,
    { compute() },
    { it.statusCode is SuccessStatusCode },
    {it.result!!},
    { PijulOperationResult("revision", SuccessStatusCode, it) }
    )
    }
    fun unload(path: Path) {
    val ctx = this.project.service<PijulVcsContext>()
    val relativePath = path.relativeTo(ctx.root).toString()
    this.invalidate(relativePath)
    }
    override fun invalidate(key: String) {
    super.invalidate(key)
    this.cache.unload("")
    }
    }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/PijulLogEntryChangeCache.kt at line 18
    [5.15107][5.15107:15343]()
    class PijulLogEntryChangeCache(val project: Project) {
    private val dataCache = DataCache<String, PijulLogEntry>(project, "path_change")
    private val revisionDataCache = DataCache<String, PijulRevisionNumber>(project, "revision")
    [5.15107]
    [5.15343]
    class PijulLogEntryChangeCache(val project: Project): CacheService<String, PijulLogEntry> {
    override val cache = DataCache<String, PijulLogEntry>(project, "path_change")
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/PijulLogEntryChangeCache.kt at line 25
    [5.15583][5.15583:15639]()
    return this.dataCache.queryOrLoad(relativePath,
    [5.15583]
    [5.15639]
    return this.cache.queryOrLoad(relativePath,
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/PijulLogEntryChangeCache.kt at line 30
    [5.15842][5.15842:16360]()
    )
    }
    fun loadRevision(path: Path, compute: () -> PijulOperationResult<PijulRevisionNumber>): PijulOperationResult<PijulRevisionNumber> {
    val ctx = this.project.service<PijulVcsContext>()
    val relativePath = path.relativeTo(ctx.root).toString()
    return this.revisionDataCache.queryOrLoad(relativePath,
    { compute() },
    { it.statusCode is SuccessStatusCode },
    {it.result!!},
    { PijulOperationResult("revision", SuccessStatusCode, it) }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/PijulLogEntryChangeCache.kt at line 36
    [5.16528][5.16528:16700]()
    this.dataCache.unload(relativePath)
    this.dataCache.unload("")
    this.revisionDataCache.unload(relativePath)
    this.revisionDataCache.unload("")
    [5.16528]
    [5.16700]
    this.invalidate(relativePath)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/PijulLogEntryChangeCache.kt at line 39
    [4.2491][4.2491:2594]()
    fun invalidate() {
    this.dataCache.invalidate()
    this.revisionDataCache.invalidate()
    [4.2491]
    [4.2594]
    override fun invalidate(key: String) {
    super.invalidate(key)
    this.cache.unload("")
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/PijulLogEntryChangeCache.kt at line 43
    [4.2600]
    [5.16706]
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/PijulLogEntryCache.kt at line 11
    [4.2658][5.11967:12016](),[5.11967][5.11967:12016](),[5.12016][5.16708:16788]()
    class PijulLogEntryCache(val project: Project) {
    private val dataCache = DataCache<String, PijulLogEntry>(project, "change")
    [4.2658]
    [5.12218]
    class PijulLogEntryCache(val project: Project): CacheService<String, PijulLogEntry> {
    override val cache = DataCache<String, PijulLogEntry>(project, "change")
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/PijulLogEntryCache.kt at line 15
    [5.16907][5.16907:16955]()
    return this.dataCache.queryOrLoad(hash,
    [5.16907]
    [5.16955]
    return this.cache.queryOrLoad(hash,
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/PijulLogEntryCache.kt at line 22
    [4.2665][4.2665:2725](),[4.2725][5.13103:13109](),[5.17147][5.13103:13109](),[5.13103][5.13103:13109]()
    fun invalidate() {
    this.dataCache.invalidate()
    }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileStatusCache.kt at line 19
    [5.17850][5.17850:17993]()
    class FileStatusCache(val project: Project) {
    private val cache = DataCache<String, CacheablePijulFileStatus>(this.project, "file_status")
    [5.17850]
    [5.17993]
    class FileStatusCache(val project: Project): CacheService<String, CacheablePijulFileStatus> {
    override val cache = DataCache<String, CacheablePijulFileStatus>(this.project, "file_status")
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileStatusCache.kt at line 63
    [5.19555][5.19555:19595]()
    this.cache.unload(relativePath)
    [5.19555]
    [4.2726]
    this.invalidate(relativePath)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileStatusCache.kt at line 66
    [4.2733][4.2733:2788]()
    fun invalidate() {
    this.cache.invalidate()
    [4.2733]
    [5.19595]
    fun updateCache(path: Path, newValueCompute: () -> CacheablePijulFileStatus) {
    val ctx = this.project.service<PijulVcsContext>()
    val relativePath = path.relativeTo(ctx.root).toString()
    super.updateCache(relativePath, newValueCompute)
    }
    fun updateCacheForPaths(paths: List<Path>, newValueCompute: (Path) -> CacheablePijulFileStatus) {
    val ctx = this.project.service<PijulVcsContext>()
    val relativePathMap = paths.associateBy { it.relativeTo(ctx.root).toString() }
    super.updateCache(relativePathMap.keys.toList()) {
    newValueCompute(relativePathMap[it]!!)
    }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 5
    [5.20261][5.20261:20392]()
    import com.github.jonathanxd.dracon.revision.PijulVcsFileRevision
    import com.github.jonathanxd.dracon.revision.loadStateInRevision
    [5.20261]
    [5.20392]
    import com.github.jonathanxd.dracon.i18n.DraconBundle
    import com.github.jonathanxd.dracon.pijul.pijul
    import com.github.jonathanxd.dracon.revision.*
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 10
    [5.20486]
    [5.20486]
    import com.intellij.openapi.progress.ProgressIndicator
    import com.intellij.openapi.progress.forEachWithProgress
    import com.intellij.openapi.progress.withPushPop
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 15
    [5.20558]
    [5.20558]
    import java.nio.file.Path
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 17
    [5.20604][5.20604:20690]()
    import java.util.concurrent.Executors
    import java.util.concurrent.locks.ReentrantLock
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 19
    [5.20700][5.20700:20841]()
    class FileRevisionCache(val project: Project) {
    private val cache = DataCache<FileRevisionRef, ByteArray>(this.project, "file_revision")
    [5.20700]
    [5.20841]
    class FileRevisionCache(val project: Project) : CacheService<FileRevisionRef, ByteArray> {
    override val cache = DataCache<FileRevisionRef, ByteArray>(this.project, "file_revision")
    fun loadAsync(rev: PijulVcsFileRevision): CompletableFuture<ByteArray> =
    this.loadAsync(rev.filePath, rev.revision)
    fun loadAsync(rev: PijulContentRevision): CompletableFuture<ByteArray> =
    this.loadAsync(rev.filePath, rev.revision)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 28
    [5.20842][5.20842:20919]()
    fun loadAsync(rev: PijulVcsFileRevision): CompletableFuture<ByteArray> {
    [5.20842]
    [5.20919]
    fun loadAsync(file: Path, rev: PijulRevisionNumber): CompletableFuture<ByteArray> {
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 30
    [5.20978][5.20978:21077]()
    val fileRev = FileRevisionRef(rev.filePath.toAbsolutePath().toString(), rev.revision.hash)
    [5.20978]
    [5.21077]
    val fileRev = FileRevisionRef(file.filePathAsString(), rev.hash)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 34
    [5.21165][5.21165:21200]()
    rev.revision.hash,
    [5.21165]
    [5.21200]
    rev.hash,
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 37
    [5.21252][5.21252:21281]()
    rev.filePath
    [5.21252]
    [5.21281]
    file
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 41
    [5.21339]
    [4.2855]
    private fun Path.filePathAsString() = this.toAbsolutePath().toString()
    fun loadAndPrecacheRevisions(amount: Int, i: ProgressIndicator) {
    this.cache.lock()
    try {
    i.isIndeterminate = false
    val root = project.service<PijulVcsContext>().root
    val revs = pijul(project).allRevisions(project, root).result?.take(amount).orEmpty()
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 51
    [4.2856][4.2856:3091]()
    fun loadAsync(rev: PijulContentRevision): CompletableFuture<ByteArray> {
    val root = project.service<PijulVcsContext>().root
    val fileRev = FileRevisionRef(rev.filePath.toAbsolutePath().toString(), rev.revision.hash)
    [4.2856]
    [4.3091]
    val states = i.withPushPop {
    i.text = DraconBundle.message("index.revision.loading.text")
    loadStateInEveryRevisionForAllFiles(
    revs.map { it.hash },
    project,
    root,
    i
    )
    }
    i.text2 = DraconBundle.message("index.item.description.finish.text")
    i.withPushPop {
    i.text = DraconBundle.message("index.revision.files.text")
    states.entries.forEachWithProgress(i) { (rev, stateMap), indic ->
    stateMap.entries.forEachWithProgress(indic) { (path, bytes), indicator2 ->
    indicator2.text2 =
    DraconBundle.message("index.revision.file.description.text", path.toString(), rev)
    val revRef = FileRevisionRef(path.filePathAsString(), rev)
    this.cache.updateCache(revRef) {
    bytes
    }
    }
    }
    }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 81
    [4.3092][4.3092:3337]()
    return this.cache.queryOrLoadAsync(fileRev) {
    loadStateInRevision(
    rev.revision.hash,
    this.project,
    root,
    rev.filePath
    ).toByteArray(Charsets.UTF_8)
    [4.3092]
    [4.3337]
    i.text2 = DraconBundle.message("index.item.description.finish.text")
    i.fraction = 1.0
    } finally {
    this.cache.unlock()
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 86
    [4.3347][4.3347:3409]()
    }
    fun invalidate() {
    this.cache.invalidate()
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/FileRevisionCache.kt at line 92
    [5.21421][5.21421:21436]()
    ): Serializable
    [5.21421]
    ) : Serializable
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 7
    [5.21663]
    [5.21663]
    import java.io.Serializable
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 11
    [5.21756]
    [5.21756]
    import java.time.Instant
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 18
    [5.22009]
    [5.22009]
    /**
    * Denotes the current version of data cache, must be updated when data cache format changes.
    */
    const val DATA_CACHE_VERSION: Long = 2
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 25
    [5.22040][5.22040:22126]()
    class DataCache<K, V>(val project: Project,
    val name: String) {
    [5.22040]
    [5.22126]
    class DataCache<K: Any, V: Any>(val project: Project,
    val name: String) {
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 30
    [5.22272][5.22272:22337]()
    private val manager = DataCacheManager<K, V>(this.cacheFile)
    [5.22272]
    [5.22337]
    private val manager = DataCacheManager<K, CachedValue<V>>(this.cacheFile, DATA_CACHE_VERSION)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 32
    [5.22376][5.22376:22441]()
    private val updateExecutor = Executors.newCachedThreadPool()
    [5.22376]
    [5.22441]
    private val updateExecutor = Executors.newFixedThreadPool(10)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 34
    [5.22442][5.22442:22495]()
    private val inMemory = ConcurrentHashMap<K, V>()
    [5.22442]
    [5.22495]
    private val inMemory = ConcurrentHashMap<K, CachedValue<V>>()
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 64
    [5.23063][5.23063:23111]()
    val computeEntry = compute(key)
    [5.23063]
    [5.23111]
    val computeEntry = CachedValue(Instant.now(), compute(key))
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 71
    [5.23299][5.23299:23313]()
    }
    [5.23299]
    [5.23313]
    }.value
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 91
    [5.23846][5.23846:23907]()
    this.inMemory[key] = iMapper(computeEntry!!)
    [5.23846]
    [5.23907]
    this.inMemory[key] = CachedValue(Instant.now(), iMapper(computeEntry!!))
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 95
    [5.24007][5.24007:24053]()
    vMapper(this.inMemory[key]!!)
    [5.24007]
    [5.24053]
    vMapper(this.inMemory[key]!!.value)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 104
    [5.24258][5.24258:24333]()
    return CompletableFuture.completedFuture(this.inMemory[key]!!)
    [5.24258]
    [5.24333]
    return CompletableFuture.completedFuture(this.inMemory[key]!!.value)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 109
    [5.24456][5.24456:24508]()
    val computeEntry = compute(key)
    [5.24456]
    [5.24508]
    val computeEntry = CachedValue(Instant.now(), compute(key))
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 116
    [5.24717][5.24717:24735]()
    }
    [5.24717]
    [5.24735]
    }.value
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 127
    [5.25092][5.25092:25176]()
    return CompletableFuture.completedFuture(vMapper(this.inMemory[key]!!))
    [5.25092]
    [5.25176]
    return CompletableFuture.completedFuture(vMapper(this.inMemory[key]!!.value))
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 137
    [5.25467][5.25467:25536]()
    this.inMemory[key] = iMapper(computeEntry!!)
    [5.25467]
    [5.25536]
    this.inMemory[key] = CachedValue(Instant.now(), iMapper(computeEntry!!))
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 148
    [4.3433]
    [4.3433]
    /**
    * @see CacheService.invalidate
    */
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 161
    [5.25791]
    [5.25791]
    /**
    * @see CacheService.invalidate
    */
    fun invalidate(key: K) {
    this.lock.lock()
    try {
    this.inMemory.remove(key)
    this.manager.write(this.inMemory)
    } finally {
    this.lock.unlock();
    }
    }
    /**
    * @see CacheService.updateCache
    */
    fun updateCache(key: K, newValueCompute: () -> V) {
    val instant = Instant.now()
    this.lock()
    try {
    val inMemoryValue = this.inMemory[key]
    if (inMemoryValue == null || inMemoryValue.instant.isBefore(instant)) {
    this.inMemory[key] = CachedValue(instant, newValueCompute())
    }
    } finally {
    this.unlock()
    }
    }
    /**
    * @see CacheService.updateCache
    */
    fun updateCache(keys: List<K>, newValueCompute: (K) -> V) {
    val instant = Instant.now()
    this.lock()
    try {
    for (key in keys) {
    val inMemoryValue = this.inMemory[key]
    if (inMemoryValue == null || inMemoryValue.instant.isBefore(instant)) {
    this.inMemory[key] = CachedValue(instant, newValueCompute(key))
    }
    }
    } finally {
    this.unlock()
    }
    }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 210
    [5.25794][5.25794:25841]()
    class DataCacheManager<K, V>(val path: Path) {
    [5.25794]
    [5.25841]
    class DataCacheManager<K, V>(val path: Path, val version: Long) {
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 222
    [5.26173][5.26173:26237]()
    return reader.readObject() as Map<K, V>
    [5.26173]
    [5.26237]
    val version = reader.readLong()
    return if (version != version) {
    emptyMap()
    } else {
    reader.readObject() as Map<K, V>
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cache/DataCache.kt at line 242
    [5.26701]
    [5.26701]
    oos.writeLong(this.version)
  • file addition: CachedValue.kt (----------)
    [5.8571]
    package com.github.jonathanxd.dracon.cache
    import java.io.Serializable
    import java.time.Instant
    class CachedValue<V>(val instant: Instant, val value: V): Serializable {
    companion object {
    const val serialVersionUID = 1L
    }
    }
  • file addition: CacheService.kt (----------)
    [5.8571]
    package com.github.jonathanxd.dracon.cache
    import com.intellij.openapi.components.Service
    import java.time.Instant
    /**
    * This is a base interface implemented by every [DataCache] service,
    * as [DataCache] is never used directly, an [IntelliJ Light Service][Service]
    * must be setup to interface a [DataCache] and classes that uses the cache.
    *
    * This interface is for [Cache][DataCache] [Services][Service] which manages a single [DataCache][cache]
    * with a [key type][K] [K] and a [value type][V] [V]. If the service does manages more than one [DataCache][cache],
    * we **heavily recommend** you to split it into two different services which communicate with each other.
    */
    interface CacheService<K: Any, V: Any> {
    val cache: DataCache<K, V>
    /**
    * Invalidates the [cache] that this service handles.
    *
    * ## **Warning**
    *
    * **This is only recommended when the cache is not working correctly, corrupted or an operation that changes
    * all the data that was previously cached takes in place.**
    *
    * **This is not recommended to be called for little changes, such as the ones that applies to only one or `N{2,}` keys
    * because it slow down the perception of the Dracon performance, as it does need to cache all the data again, and as the
    * cache is backed by a temporary file in the seconday storage (not a memory one), it does depends on the I/O
    * overhead, which is good for NVMe storages and SATA 3 ones, but not for HDDs. Also some `pijul` operations are really
    * expensive, such as `pijul unrecord`, the Dracon Log Algorithm, Dracon File Status algorithms and Dracon Revision
    * load algorithm (backed by `pijul unrecord`), when the cache of these operations is invalidated, the overall
    * performance Dracon drops absurdly.**
    *
    * @see DataCache
    */
    fun invalidate() {
    this.cache.invalidate()
    }
    /**
    * Invalidates one key in [cache], this is a good way to invalidate data in cache (but not the best one), as it does not
    * cause all the cache to be recomputed, however, if you already know the new value for the cache, or a function
    * to compute it, use [updateCache] function.
    *
    */
    fun invalidate(key: K) {
    this.cache.invalidate(key)
    }
    /**
    * Updates the cache value of a [key] using the [newValueCompute]. This is the best way to update the cache data,
    * as it does provides either a lightweight function to compute the new cache value, or a constant computed value
    * that does not involve a new computation routine.
    *
    * Please note that this function does not guarantee that the new computed value will be inserted into the cache,
    * because the cache could be updated between the time you change something that need to be reflected in the cache,
    * and the time request to update the key, if a cache recompute operation takes in this time between, the
    * service will ignore the provided [newValueCompute]. The up-to-date check is made using [CachedValue] container,
    * which holds the [Instant] which provides the time that an operation requested to update the cache (not the time the
    * update takes place). However this check do not guarantee that the cached value will be up-to-date, as we cannot guarantee
    * that the time the operation was requested matches the time the data was created.
    */
    fun updateCache(key: K, newValueCompute: () -> V) {
    this.cache.updateCache(key, newValueCompute)
    }
    /**
    * Updates the cache value of multiple [keys] using the [newValueCompute]. This is the best way to update the cache data,
    * as it does provides either a lightweight function to compute the new cache value, or a constant computed value
    * that does not involve a new computation routine.
    *
    * Please note that this function does not guarantee that the new computed value will be inserted into the cache,
    * because the cache could be updated between the time you change something that need to be reflected in the cache,
    * and the time request to update the key, if a cache recompute operation takes in this time between, the
    * service will ignore the provided [newValueCompute]. The up-to-date check is made using [CachedValue] container,
    * which holds the [Instant] which provides the time that an operation requested to update the cache (not the time the
    * update takes place). However this check do not guarantee that the cached value will be up-to-date, as we cannot guarantee
    * that the time the operation was requested matches the time the data was created.
    */
    fun updateCache(keys: List<K>, newValueCompute: (K) -> V) {
    this.cache.updateCache(keys, newValueCompute)
    }
    }
  • file addition: annotation (----------)
    [5.107]
  • file addition: NeedsCacheUpdate.kt (----------)
    [0.40561]
    package com.github.jonathanxd.dracon.annotation
    import com.github.jonathanxd.dracon.cache.CacheService
    /**
    * Signals that to an operation take effect in IntelliJ, the underling cache needs to be updated.
    *
    *
    * There are two ways of updating the underling cache:
    *
    * #### Execute [CacheService.invalidate]
    *
    * It does cleanup the entire cache, which is only recommended for when the change does update everything that was cached,
    * or when the user requests to invalidate the cache, because the cache may be not working correctly or corrupt.
    *
    */
    annotation class NeedsCacheUpdate()
  • file move: activity (----------)activity (d--r------)
    [5.107]
    [4.3639]
  • file addition: PijulIndexActivity.kt (----------)
    [4.3639]
    package com.github.jonathanxd.dracon.activity
    import com.github.jonathanxd.dracon.cache.FileRevisionCache
    import com.github.jonathanxd.dracon.i18n.DraconBundle
    import com.intellij.openapi.components.service
    import com.intellij.openapi.progress.ProgressIndicator
    import com.intellij.openapi.progress.Task
    import com.intellij.openapi.project.Project
    import com.intellij.openapi.startup.StartupActivity
    const val PRE_INDEX_REVISION_AMOUNT = 30
    class PijulIndexActivity : StartupActivity.Background {
    override fun runActivity(project: Project) {
    object : Task.Backgroundable(project, DraconBundle.message("index.revision.text")) {
    override fun run(indicator: ProgressIndicator) {
    val fileRevisionCache = project.service<FileRevisionCache>()
    fileRevisionCache.loadAndPrecacheRevisions(PRE_INDEX_REVISION_AMOUNT, indicator)
    }
    }.queue()
    }
    }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulInvalidateCaches.kt at line 13
    [4.12502][4.12502:12748]()
    import com.github.jonathanxd.dracon.cache.FileRevisionCache
    import com.github.jonathanxd.dracon.cache.FileStatusCache
    import com.github.jonathanxd.dracon.cache.PijulLogEntryCache
    import com.github.jonathanxd.dracon.cache.PijulLogEntryChangeCache
    [4.12502]
    [4.12748]
    import com.github.jonathanxd.dracon.cache.*
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulInvalidateCaches.kt at line 51
    [4.14647][4.14647:14689]()
    indicator.fraction = 0.25
    [4.14647]
    [4.14689]
    indicator.fraction = 0.20
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulInvalidateCaches.kt at line 56
    [4.14917][4.14917:14959]()
    indicator.fraction = 0.50
    [4.14917]
    [4.14959]
    indicator.fraction = 0.40
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulInvalidateCaches.kt at line 61
    [4.15190][4.15190:15232]()
    indicator.fraction = 0.75
    [4.15190]
    [4.15232]
    indicator.fraction = 0.60
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulInvalidateCaches.kt at line 66
    [4.15489]
    [4.15489]
    indicator.fraction = 0.80
    val logRevisionCache = project.service<PijulLogRevisionCache>()
    indicator.text2 = DraconBundle.message("cache.invalidate.current.text", "pijul log entry revision cache")
    logRevisionCache.invalidate()
  • file addition: PijulIgnoreActionGroup.kt (----------)
    [5.18106]
    package com.github.jonathanxd.dracon.actions
    import com.intellij.openapi.vcs.changes.ignore.actions.IgnoreFileActionGroup
    import com.intellij.openapi.vcs.changes.ignore.lang.IgnoreFileType
    object PijulIgnoreActionGroup : IgnoreFileActionGroup(IgnoreFileType.INSTANCE)
  • file addition: PijulAddToIgnore.kt (----------)
    [5.18106]
    /**
    * Dracon - An IntelliJ-Pijul integration.
    * Copyright 2021 JonathanxD <jhrldev@gmail.com>
    *
    * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    *
    * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    *
    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    */
    package com.github.jonathanxd.dracon.actions
    import com.github.jonathanxd.dracon.i18n.DraconBundle
    import com.github.jonathanxd.dracon.pijul.NonZeroExitStatusCode
    import com.github.jonathanxd.dracon.pijul.Pijul
    import com.github.jonathanxd.dracon.pijul.pijul
    import com.github.jonathanxd.dracon.util.wrapInHml
    import com.github.jonathanxd.dracon.vcs.DraconVcsUtil
    import com.github.jonathanxd.dracon.vcs.NotificationIds
    import com.github.jonathanxd.dracon.vfs.DraconVfsUtil
    import com.intellij.openapi.actionSystem.AnActionEvent
    import com.intellij.openapi.actionSystem.CommonDataKeys
    import com.intellij.openapi.fileChooser.FileChooser
    import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
    import com.intellij.openapi.progress.ProgressIndicator
    import com.intellij.openapi.progress.Task
    import com.intellij.openapi.project.DumbAwareAction
    import com.intellij.openapi.project.ProjectManager
    import com.intellij.openapi.ui.Messages
    import com.intellij.openapi.vcs.ProjectLevelVcsManager
    import com.intellij.openapi.vcs.VcsNotifier
    import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager
    import com.intellij.vcsUtil.VcsUtil
    class PijulAddToIgnore: DumbAwareAction() {
    override fun actionPerformed(e: AnActionEvent) {
    val project = e.getData(CommonDataKeys.PROJECT) ?: ProjectManager.getInstance().defaultProject
    val fcd = FileChooserDescriptorFactory.createSingleFileDescriptor()
    fcd.isShowFileSystemRoots = true
    fcd.title = DraconBundle.Init.title
    fcd.description = DraconBundle.Init.description
    fcd.isHideIgnored = false
    val baseDir = e.getData(CommonDataKeys.VIRTUAL_FILE)?.let { if (it.isDirectory) null else it } ?: project.baseDir
    FileChooser.chooseFile(fcd, project, baseDir) { root ->
    if (Pijul.isUnderPijul(root)) {
    val dialog = Messages.showYesNoCancelDialog(
    project,
    DraconBundle.Init.alreadyUnderPijulForHtml(root.presentableUrl),
    DraconBundle.Init.title,
    Messages.getWarningIcon()
    )
    if (dialog != Messages.YES) {
    return@chooseFile
    }
    }
    object : Task.Backgroundable(project, DraconBundle.Dracon.refreshing) {
    override fun run(indicator: ProgressIndicator) {
    indicator.isIndeterminate = true
    val init = pijul(project).init(project, root)
    if (init.statusCode is NonZeroExitStatusCode) {
    VcsNotifier
    .getInstance(this.project)
    .notifyError(
    NotificationIds.FAILED_TO_INIT,
    DraconBundle.Init.error,
    init.statusCode.message.wrapInHml(),
    true
    )
    }
    if (project.isDefault) {
    return
    }
    // Refresh VCS?
    DraconVcsUtil.refreshAfterInit(project, root)
    }
    }.queue()
    }
    }
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulAddExtension.kt at line 13
    [5.23019]
    [5.23019]
    import com.github.jonathanxd.dracon.cache.CacheablePijulFileStatus
    import com.github.jonathanxd.dracon.cache.FileStatusCache
    import com.github.jonathanxd.dracon.cache.toPijul
    import com.github.jonathanxd.dracon.pijul.SuccessStatusCode
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulAddExtension.kt at line 19
    [5.23112]
    [5.23112]
    import com.intellij.openapi.components.service
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulAddExtension.kt at line 26
    [5.23411]
    [5.23411]
    import com.intellij.vcsUtil.VcsUtil
    import java.nio.file.Paths
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/actions/PijulAddExtension.kt at line 44
    [5.24072][5.24072:24124]()
    pijul(project).add(project, vcsRoot, paths)
    [5.24072]
    [5.24124]
    val trackedFiles = pijul(project).trackedFiles(project, Paths.get(VcsUtil.getFilePath(vcsRoot).path))
    val add = pijul(project).add(project, vcsRoot, paths)
    if (add.statusCode is SuccessStatusCode) {
    val pathsAsNio = paths.map {
    Paths.get(it.path).toAbsolutePath()
    }.filter { trackedFiles.result == null || !trackedFiles.result.contains(it) }
    project.service<FileStatusCache>()
    .updateCacheForPaths(pathsAsNio) {
    FileStatus.ADDED.toPijul()
    }
    }
  • replacement in README.md at line 13
    [5.28936][5.28936:29026]()
    - [ ] Support loading file changes
    - Partially supported as FileStatus depends on this.
    [5.28936]
    [3.0]
    - [X] Support loading file changes
    - Supported, but does introduce overheads. Read **[file changes loading](#file-changes-loading-overhead)** section.
  • replacement in README.md at line 16
    [3.42][3.42:143]()
    - Does not support amend.
    - Record text file opens in default editor instead of IntelliJ Editor.
    [3.42]
    [5.59535]
    - [ ] Support amend.
    - ~~Record text file opens in default editor instead of IntelliJ Editor.~~
    - [X] Record text is opened in IntelliJ IDEA powered by [editor-server](https://crates.io/crates/editor-server) backend.
    - [X] File history support
    - [X] Allows users to compare between revisions
    - [X] Allows users to see affected files for any given revision.
  • edit in README.md at line 30
    [5.1213159]
    [5.6405]
    Dracon is in a heavily experimental state, and it depends on latest IDEA EAP build.
    ### Pick a build
  • replacement in README.md at line 35
    [5.6406][2.0:500]()
    Dracon is in a heavily experimental state, and it depends on latest IDEA EAP build. First download an **experimental** or **nightly** build from [builds](https://nest.pijul.com/Jonathan/Dracon:main/MJDBCNFHSHAR4.BEAAA) directory (probably you will need to clone this repo to get the zip file), then go to IntelliJ IDEA Plugins section and click in the gear on the right side of *Installed tab* and select *Install plugin from Disk...* and select the downloaded Dracon *.zip*. Now you're ready to go.
    [5.6406]
    [5.6406]
    The easiest way is to pick an officially packaged version of Dracon which we periodically publish.
    First download an **experimental** or **nightly** build from [builds](https://nest.pijul.com/Jonathan/Dracon:main/MJDBCNFHSHAR4.BEAAA) directory (probably you will need to clone this repo to get the zip file), then go to IntelliJ IDEA Plugins section and click in the gear on the right side of *Installed tab* and select *Install plugin from Disk...* and select the downloaded Dracon *.zip*. Now you're ready to go.
  • edit in README.md at line 40
    [3.391]
    [5.1213904]
    ### Build on your own
    First clone Dracon repository:
    ```bash
    pijul clone https://nest.pijul.com/Jonathan/Dracon
    ```
    Then create build and package the plugin using `buildPlugin` gradle task:
  • edit in README.md at line 52
    [5.1213905]
    [5.1213905]
    For Unix:
    ```bash
    ./gradlew buildPlugin
    ```
    For Windows:
    ```batch
    .\gradlew.bat buildPlugin
    ```
    The generated plugin file could be find in `build/distributions` path, the installation of the plugin `.zip` is exactly the same as for an officially made build: Go to IntelliJ IDEA Plugins section and click in the gear on the right side of *Installed* tab and select *Install plugin from Disk...* and select the generated Dracon *.zip*.
    ### JetBrains Marketplace
  • replacement in README.md at line 68
    [5.1213336][5.14230:14467]()
    Recently versions of Dracon requires [editor-server](https://crates.io/crates/editor-server) to be installed in order to work, the final
    release version will come bundled with the [editor-server](https://crates.io/crates/editor-server).
    [5.1213336]
    [5.14467]
    ### Dependencies
    Recently versions of Dracon requires [editor-server](https://crates.io/crates/editor-server) to be installed in order to work, ~~the final
    release version will come bundled with the [editor-server](https://crates.io/crates/editor-server).~~ The most recent version of Dracon does prompts for Pijul and Editor-Server download, as this requires Cargo in order to install dependencies if it is not installed, Dracon will prompt for Rustup and Cargo installation, it does the baby steps for installation, but you take the lead as soon as choices need to be made.
    ## File Changes Loading Overhead
    Pijul does not have an easy way to retrieve the state of a file in a given revision, in order to support this, Dracon creates a copy of the repository in a temporary directory and execute `pijul unrecord` against all revisions that happened after the given revision.
    For CoW based file systems, such as ZFS and Btrfs, this operation is very cheap, and as long as all the files are not modified when **pijul unrecord** changes, this overhead may not be perceptible. However, there are some cases when this overhead becomes very perceptible, for example, when the amount of revisions between the target revision (the revision who you want to see), and the current revision (the last recorded revision), are bigger.
    So, how much bigger is bigger enough to be perceptible? I'm not sure, I don't have enough samples to conclude the exact amount of changes that are needed in order to this operation overhead be perceptible, it also depends on the complexity of the entire operation, how many files changed between these revisions, the complexity of these changes, the performance of the secondary storage (Read/Write). I've been tested Dracon and made a bunch of performance improvements, such as caching, which improved the overall performance of revision loading and project loading.
    ~~An NVMe SSD and a CoW file system alleviate this a bit, however I'm always working in strategies to improve the performance, however when Pijul provides a way to see the state of a file in a given revision, I will use it instead of the actual routine.~~
    In the most current versions, Dracon does a bunch of caching and preloads file revisions, also caching code has been the focus of the development now that Dracon is almost ready for a nightly release. However, there is room for improvements.
    ~~Also, I'm currently improving the rollback algorithm to *unrecord* only revision which actually change the file, instead of all revisions between the actual revision (inclusively) and the target revision (exclusively) by looking at `pijul credit`~~
    Plans have changed, instead of only un-recording changes that `pijul credit` annotated, Dracon save the state of other files of a given revision, speeding things a bit and reducing the amount of `pijul unrecord` we execute (currently only for the caching).