Improved support for revisions

[?]
Mar 31, 2021, 10:43 PM
ZCRW57C5MSBXYGUMGQTZNHGHO4HGHFBICW53X5I2IMGP3H2CKWRQC

Dependencies

  • [2] Q7FXTHVU First record support, YEAAAH, RECOOORD
  • [3] EAGIDXOL Build 2 to only listen to changes in project under pijul
  • [4] FRFFQV7V Basic show history support.
  • [5] 6CR2EFUN First ChangeProvider implementation!!! Wheehooo
  • [6] QXUEMZ3B Initial CahngeProvider
  • [7] NTRPUMVQ Improved README and added roadmap.
  • [8] FNNW5IEA Added more plugin files to Pijul
  • [9] GGYFPXND Initial plugin
  • [10] MTPTFTHG Initial plugin 2
  • [11] OPFG6CZ2 File status tracking supported.
  • [*] 7L5LODGZ Parse changes from `pijul change`

Change contents

  • edit in src/main/resources/messages/DraconBundle.properties at line 18
    [4.82]
    [4.82]
    action.Pijul.ExpertRecord.text=Record (Expert Mode)...
  • replacement in src/main/resources/messages/DraconBundle.properties at line 32
    [2.58][2.58:80]()
    record.author=&Author:
    [2.58]
    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>.
    expert.mode.notification.failure=Failed to record changes with exit code <bold>{0}</bold> and message: <tt>{1}</tt>.
  • edit in src/main/resources/META-INF/plugin.xml at line 1
    [4.1490][4.1129:2270]()
    <!--
    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.
    -->
  • edit in src/main/resources/META-INF/plugin.xml at line 19
    [4.2209]
    [4.2209]
    <depends>org.toml.lang</depends>
  • edit in src/main/resources/META-INF/plugin.xml at line 21
    [4.2210]
    [4.2210]
  • edit in src/main/resources/META-INF/plugin.xml at line 32
    [4.964]
    [4.2261]
    <completion.contributor language="TOML" implementationClass="com.github.jonathanxd.dracon.completion.PijulCompletionContributor" />
  • edit in src/main/resources/META-INF/plugin.xml at line 42
    [4.1246]
    [4.1246]
    <action id="Pijul.ExpertRecord" class="com.github.jonathanxd.dracon.actions.PijulExpertRecord"/>
  • edit in src/main/resources/META-INF/plugin.xml at line 56
    [4.2072]
    [4.2072]
    <reference ref="CheckinFiles"/>
    <reference ref="CheckinProject"/>
    <reference ref="Pijul.ExpertRecord"/>
    <separator/>
    <reference ref="Compare.SameVersion"/>
    <reference ref="Compare.Selected"/>
  • edit in src/main/resources/META-INF/plugin.xml at line 69
    [4.2367][4.2367:2368]()
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/vfs/PijulVirtualFileStatusProvider.kt at line 18
    [4.281]
    [4.281]
    import com.intellij.openapi.vcs.ProjectLevelVcsManager
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/vfs/PijulVirtualFileStatusProvider.kt at line 24
    [3.121][3.121:167]()
    if (!Pijul.isUnderPijul(virtualFile))
    [3.121]
    [3.167]
    if (!Pijul.isUnderPijul(virtualFile) || isIdeaRoot(virtualFile))
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/vfs/PijulVirtualFileStatusProvider.kt at line 33
    [4.250][4.250:298]()
    status.result ?: FileStatus.UNKNOWN
    [4.250]
    [4.298]
    status.result
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/vfs/PijulVirtualFileStatusProvider.kt at line 36
    [3.210]
    [4.346]
    }
    }
    fun isIdeaRoot(virtualFile: VirtualFile): Boolean {
    val root = ProjectLevelVcsManager.getInstance(project).getVcsRootFor(virtualFile)
    if (root != null) {
    return root == virtualFile || virtualFile.toNioPath().toAbsolutePath().toString().startsWith(
    root.toNioPath().toAbsolutePath().resolve(".idea").toString()
    )
    } else {
    return false
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 5
    [4.748]
    [4.748]
    import com.intellij.openapi.util.io.FileUtilRt
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 7
    [4.789][4.789:833]()
    import com.intellij.openapi.vfs.VirtualFile
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 50
    [2.439]
    [2.439]
    val tempDir = FileUtilRt.createTempDirectory("dracon_diffs-", revisionHash)
    val tmpTarget = tempDir.toPath()
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 53
    [2.440][2.440:790]()
    val tmpTarget = Paths.get(project.baseDir.path, ".idea", "dracon_diffs", revisionHash)
    if (Files.exists(tmpTarget)) {
    Files.walk(tmpTarget).use { walk ->
    walk.sorted(Comparator.reverseOrder())
    .map(Path::toFile)
    .forEach(File::delete)
    }
    }
    Files.createDirectories(tmpTarget)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/revision/RevisionContentResolver.kt at line 63
    [2.1276][4.2250:2251](),[4.2250][4.2250:2251](),[4.2251][2.1277:1334]()
    return Files.readString(tmpTarget.resolve(filePath))
    [2.1276]
    [2.1334]
    val relativeToRoot = filePath.subpath(root.nameCount, filePath.nameCount)
    try {
    return Files.readString(tmpTarget.resolve(relativeToRoot))
    } finally {
    FileUtilRt.delete(tempDir)
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/PijulVcsFileRevision.kt at line 5
    [4.3240]
    [4.3240]
    import com.intellij.openapi.vcs.LocalFilePath
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/PijulVcsFileRevision.kt at line 8
    [4.3347]
    [4.3347]
    import com.intellij.openapi.vcs.history.VcsFileRevisionEx
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/PijulVcsFileRevision.kt at line 10
    [4.3405]
    [4.3405]
    import com.intellij.vcs.log.VcsUser
    import java.nio.file.Files
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/revision/PijulVcsFileRevision.kt at line 22
    [4.3659][4.3659:3708]()
    val author_: String?,
    [4.3659]
    [4.3708]
    val authors: List<VcsUser>,
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/revision/PijulVcsFileRevision.kt at line 24
    [4.3757][4.3757:3825]()
    val branch: String?) : VcsFileRevision {
    [4.3757]
    [2.1489]
    val branch: String?,
    val deleted: Boolean) : VcsFileRevisionEx(), Comparable<PijulVcsFileRevision> {
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/revision/PijulVcsFileRevision.kt at line 32
    [2.1677][2.1677:1711]()
    author_: String?,
    [2.1677]
    [2.1711]
    authors: List<VcsUser>,
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/revision/PijulVcsFileRevision.kt at line 34
    [2.1745][2.1745:1884]()
    branch: String?): this(project, vcsRoot, Paths.get(filePath.path).relativeTo(vcsRoot), revision, author_, message, branch)
    [2.1745]
    [4.3825]
    branch: String?,
    deleted: Boolean): this(project, vcsRoot, Paths.get(filePath.path).relativeTo(vcsRoot), revision, authors, message, branch, deleted)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/revision/PijulVcsFileRevision.kt at line 46
    [4.4212][4.4212:4265]()
    override fun getAuthor(): String? = this.author_
    [4.4212]
    [4.4265]
    override fun getAuthor(): String? = this.authors.map { it.name }.firstOrNull()
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/revision/PijulVcsFileRevision.kt at line 53
    [4.4456]
    [4.4456]
    override fun getAuthorEmail(): String? =
    this.authors.map { it.email }.firstOrNull()
    override fun getCommitterName(): String? = this.author
    override fun getCommitterEmail(): String? = this.authorEmail
    override fun getPath(): FilePath =
    LocalFilePath(this.filePath, Files.isDirectory(this.filePath))
    override fun getAuthorDate(): Date? = Date.from(this.revision.timestamp.toInstant())
    override fun isDeleted(): Boolean = this.deleted
    override fun compareTo(other: PijulVcsFileRevision): Int =
    this.revision.timestamp.compareTo(other.revision.timestamp)
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 3
    [4.4532]
    [4.4532]
    import com.github.jonathanxd.dracon.log.FileDelHunk
    import com.github.jonathanxd.dracon.log.HunkWithPath
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 19
    [4.5253]
    [4.5253]
    import com.intellij.vcs.log.impl.VcsUserImpl
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 55
    [4.6514][4.6514:6576]()
    it.authors.map { it.name }.firstOrNull(),
    [4.6514]
    [4.6576]
    it.authors.map { VcsUserImpl(it.name ?: "", it.email ?: "") }.filter { it.name.isNotEmpty() },
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 57
    [4.6608][4.6608:6643]()
    currentChannel
    [4.6608]
    [4.6643]
    currentChannel,
    false
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 84
    [4.7565][4.7565:7967]()
    partner.acceptRevision(
    PijulVcsFileRevision(
    this.project,
    root.toNioPath(),
    path,
    PijulRevisionNumber(it.changeHash, it.date),
    it.authors.map { it.name }.firstOrNull(),
    it.message,
    currentChannel
    [4.7565]
    [4.7967]
    it.hunks.filterIsInstance<HunkWithPath>().groupBy {
    it.resolvePath(root.toNioPath())
    }.forEach { path, hunks ->
    val deleted = hunks.any { it is FileDelHunk }
    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
    )
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 101
    [4.7989][4.7989:8007]()
    )
    [4.7989]
    [4.8007]
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 149
    [4.9549][4.9549:9556]()
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 150
    [4.9557][4.9557:9823]()
    /*override fun createFromCachedData(
    cacheable: Boolean?,
    revisions: MutableList<out VcsFileRevision>,
    filePath: FilePath,
    currentRevision: VcsRevisionNumber?
    ): VcsAbstractHistorySession {
    TODO("Not yet implemented")
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulHistoryProvider.kt at line 151
    [4.9829][4.9829:10035]()
    override fun getBaseVersionContent(
    filePath: FilePath?,
    processor: Processor<in String>?,
    beforeVersionId: String?
    ): Boolean {
    TODO("Not yet implemented")
    }*/
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 33
    [4.955]
    [4.955]
    val rootAbsolute = root!!.toNioPath().toAbsolutePath()
    if (dir.path.startsWith(rootAbsolute.resolve(".pijul").toString()))
    continue;
    if (dir.path.startsWith(rootAbsolute.resolve(".idea").toString()))
    continue;
    if (!dir.path.startsWith(rootAbsolute.toString()))
    continue;
    if (!dir.path.startsWith(project.baseDir.toNioPath().toAbsolutePath().toString()))
    continue;
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 59
    [4.1449][4.1449:1515]()
    val path = Paths.get(dir.path, hunk.path)
    [4.1449]
    [4.1515]
    val path = Paths.get(dir.path, hunk.resolvedPath)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 64
    [4.1683][4.1683:1996]()
    PijulContentRevision(
    rootPath,
    filePath,
    head,
    this.project
    ), CurrentContentRevision.create(filePath),
    [4.1683]
    [4.1996]
    null, CurrentContentRevision.create(filePath),
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 69
    [4.2148][4.2148:2214]()
    val path = Paths.get(dir.path, hunk.path)
    [4.2148]
    [4.2214]
    val path = Paths.get(dir.path, hunk.resolvedPath)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 76
    [4.2482][4.2482:2528]()
    filePath,
    [4.2482]
    [4.2528]
    path,
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 79
    [4.2619][4.2619:2695]()
    ), CurrentContentRevision.create(filePath),
    [4.2619]
    [4.2695]
    ), null,
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 84
    [4.2853][4.2853:2919]()
    val path = Paths.get(dir.path, hunk.path)
    [4.2853]
    [4.2919]
    val path = Paths.get(dir.path, hunk.resolvedPath)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/provider/PijulChangeProvider.kt at line 99
    [4.3552][4.3552:3618]()
    val path = Paths.get(dir.path, hunk.path)
    [4.3552]
    [4.3618]
    val path = Paths.get(dir.path, hunk.resolvedPath)
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/pijul/diff/PijulDiffFromHistoryHandler.kt at line 78
    [4.12689]
    [4.12689]
    override fun showChangesBetweenRevisions(
    path: FilePath,
    older: PijulVcsFileRevision,
    newer: PijulVcsFileRevision?
    ) {
    super.showChangesBetweenRevisions(path, older, newer)
    }
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/pijul/Pijul.kt at line 99
    [2.4856]
    [2.4856]
    @RequiresBackgroundThread
    fun recordToString(project: Project, root: Path): PijulOperationResult<String>
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/pijul/Pijul.kt at line 103
    [2.4857]
    [4.4747]
    @RequiresBackgroundThread
    fun recordFromString(project: Project, root: Path, record: String): PijulOperationResult<String>
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/log/PijulLog.kt at line 4
    [13.61125]
    [4.2039]
    import java.nio.file.Path
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/log/PijulLog.kt at line 77
    [4.13913]
    [13.62495]
    fun resolvePath(root: Path): Path =
    root.resolve(this.resolvedPath)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/i18n/DraconBundle.kt at line 24
    [4.8752][4.8752:8854]()
    fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): @Nls String {
    [4.8752]
    [4.8854]
    @Nls
    fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String {
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/content/PijulContentRevision.kt at line 3
    [4.5082][4.5082:5130]()
    import com.github.jonathanxd.dracon.pijul.pijul
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/content/PijulContentRevision.kt at line 5
    [4.14925][4.5195:5241](),[4.5195][4.5195:5241]()
    import com.intellij.openapi.diagnostic.logger
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/content/PijulContentRevision.kt at line 10
    [4.5440][4.5440:5598]()
    import com.intellij.vcsUtil.VcsUtil
    import java.io.File
    import java.io.IOException
    import java.nio.file.*
    import java.nio.file.attribute.BasicFileAttributes
    [4.5440]
    [4.5598]
    import java.nio.file.Files
    import java.nio.file.Path
    import java.nio.file.Paths
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/content/PijulContentRevision.kt at line 14
    [4.5640][4.5640:5701]()
    import kotlin.io.path.relativeTo
    import java.util.Comparator
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/content/PijulContentRevision.kt at line 26
    [2.5175][2.5175:5283]()
    project: Project): this(root, Paths.get(filePath.path).relativeTo(root), revision, project)
    [2.5175]
    [4.5864]
    project: Project): this(root, Paths.get(filePath.path), revision, project)
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 15
    [4.15130]
    [4.15130]
    import com.github.jonathanxd.dracon.context.PijulVcsContext
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 25
    [4.11347]
    [4.7810]
    import com.intellij.openapi.components.service
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 28
    [4.11438]
    [4.11438]
    import com.intellij.openapi.util.io.FileUtilRt
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 47
    [4.11957]
    [4.2836]
    import java.nio.file.StandardOpenOption
    import java.util.*
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 203
    [2.7888]
    [2.7888]
    }
    }
    override fun recordToString(
    project: Project,
    root: Path
    ): PijulOperationResult<String> {
    val arguments = mutableListOf("record")
    val uuid = UUID.randomUUID().toString()
    val tempFile = createCopieTempFile(uuid)
    val operation = this.createPainlessExecPijulWithCopieOperation(
    this.project,
    root,
    tempFile,
    CopieMode.TO,
    arguments
    )
    return this.doExecutionWithMapperEvenFailed("record", operation) {
    val data = Files.readString(tempFile, Charsets.UTF_8)
    deleteCopieTempDir(uuid)
    data
    }
    }
    override fun recordFromString(project: Project, root: Path, record: String): PijulOperationResult<String> {
    val arguments = mutableListOf("record")
    val uuid = UUID.randomUUID().toString()
    val tempFile = createCopieTempFile(uuid)
    Files.writeString(tempFile, record, Charsets.UTF_8, StandardOpenOption.CREATE_NEW)
    val operation = this.createPainlessExecPijulWithCopieOperation(
    this.project,
    root,
    tempFile,
    CopieMode.FROM,
    arguments
    )
    return this.doExecutionWithMapper("record", operation) {
    deleteCopieTempDir(uuid)
    it
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 304
    [4.16983]
    [4.16983]
    val ctx = project.service<PijulVcsContext>()
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 306
    [4.17048][4.17048:17113]()
    val filePath = Paths.get(file.path).relativeTo(rootPath)
    [4.17048]
    [4.11222]
    val filePath = ctx.resolveUnderVcs(file)
    val isRootPath = ctx.isRootPath(filePath)
    val filePathAsStr = ctx.resolveRelativeToRoot(filePath)
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 339
    [4.18310][4.18310:18552]()
    if (filePath.toString().equals(hunk.resolvedPath, ignoreCase = true)) {
    if (hunk is FileAddHunk) {
    isAdd = true
    }
    [4.18310]
    [4.18552]
    val hunkPath = hunk.resolvePath(rootPath)
    if (isRootPath) {
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 343
    [4.18605]
    [4.18605]
    } else {
    if (Files.isDirectory(filePath)) {
    if (hunkPath == filePath) {
    if (hunk is FileAddHunk) {
    isAdd = true
    }
    shouldConsume = true
    } else if (hunkPath.startsWith(filePath)) {
    shouldConsume = true
    }
    } else {
    if (hunkPath == filePath) {
    if (hunk is FileAddHunk) {
    isAdd = true
    }
    shouldConsume = true
    }
    }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 427
    [2.8294][2.8294:8377]()
    filePath.toString().equals(it.resolvedPath, ignoreCase = true)
    [2.8294]
    [2.8377]
    val resolved = it.resolvePath(root)
    filePath == resolved
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 481
    [4.4582]
    [4.4582]
    }
    }
    fun <T> doExecutionWithMapperEvenFailed(name: String,
    execution: PijulExecution,
    regularStreamStringMapper: (String) -> T?): PijulOperationResult<T> {
    val status = runBlocking(Dispatchers.IO) {
    execution.status.first()
    }
    return if (status == 0) {
    val std = runBlocking(Dispatchers.IO) {
    execution.regularStream.toList().joinToString("\n")
    }
    PijulOperationResult(name, SuccessStatusCode, regularStreamStringMapper(std))
    } else {
    val error = runBlocking(Dispatchers.IO) {
    execution.errorStream.toList().joinToString("\n")
    }
    PijulOperationResult(name, NonZeroExitStatusCode(status, error), regularStreamStringMapper(""))
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 570
    [4.22075][4.22075:22206]()
    dir: Path,
    args: List<String>): PijulExecution {
    [4.22075]
    [4.22206]
    dir: Path,
    args: List<String>): PijulExecution {
    val process = ProcessBuilder()
    .command(listOf(this.findPijul()) + args)
    .directory(dir.toFile())
    .start()
    val input = process.inputStream
    val error = process.errorStream
    return PijulExecution(
    input.linesToFlow().onEach {
    draconConsoleWriter(project).logCommand("pijul", args, it)
    },
    error.linesToFlow().onEach {
    draconConsoleWriter(project).logCommandError("pijul", args, it)
    },
    flow {
    process.onExit().await()
    val exit = process.exitValue()
    if (exit == 0) {
    draconConsoleWriter(project).logCommand("pijul", args, "<Exit status> $exit")
    } else {
    draconConsoleWriter(project).logCommandError("pijul", args, "<Exit status> $exit")
    }
    emit(exit)
    }.flowOn(Dispatchers.IO)
    )
    }
    /**
    * 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 createPainlessExecPijulWithCopieOperation(project: Project,
    dir: Path,
    copiePath: Path,
    copieMode: CopieMode,
    args: List<String>): PijulExecution {
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 622
    [4.22245]
    [4.22245]
    .apply {
    when(copieMode) {
    CopieMode.FROM -> environment()["COPIE_FROM"] = copiePath.toAbsolutePath().toString()
    CopieMode.TO -> environment()["COPIE_TO"] = copiePath.toAbsolutePath().toString()
    }
    environment()["VISUAL"] = "copie"
    environment()["EDITOR"] = "copie"
    }
  • replacement in src/main/kotlin/com/github/jonathanxd/dracon/cmd/PijulCmd.kt at line 718
    [4.18094][4.18094:18095]()
    }
    [4.18094]
    fun createCopieTempFile(hash: String): Path {
    val tempDir = FileUtilRt.createTempDirectory("dracon_records-", hash).toPath()
    return tempDir.resolve("record")
    }
    fun deleteCopieTempDir(hash: String) {
    val tempDir = FileUtilRt.createTempDirectory("dracon_records-", hash).toPath()
    FileUtilRt.delete(tempDir.toFile())
    }
    enum class CopieMode {
    FROM,
    TO
    }
    }
    /**
    * Returns whether [resolvedPath] is a directory inside [this] [Path].
    *
    * @param root The root path for [this] [Path] and [resolvedPath].
    */
    fun Path.isInside(root: Path, resolvedPath: String) =
    if (this == root) {
    true
    } else if (Files.isDirectory(this) && resolvedPath.startsWith(this.toString())) {
    true
    } else if (!Files.isDirectory(this)) {
    this.toString().equals(resolvedPath, ignoreCase = true)
    } else {
    false
    }
    /**
    * Returns whether [this] path is equal the [path].
    */
    fun String.isEqual(path: Path) =
    path.toString() == this
    /**
    * Returns whether [this] path is equal the [path].
    */
    fun String.isPathEqual(path: String) =
    this.removeTrailingSlash().equals(path.removeTrailingSlash(), ignoreCase = true)
    fun String.removeTrailingSlash() =
    if (this.length > 1 && this.endsWith("/")) this.substring(0, this.length - 1)
    else this
    /**
    * Returns whether [this] path is inside the [path].
    */
    fun String.isInside(path: Path) =
    path.startsWith(this)
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/checkin/PijulCheckingEnvironment.kt at line 10
    [2.8956]
    [2.8956]
    import com.intellij.openapi.fileEditor.FileEditorManager
    import com.intellij.openapi.fileEditor.OpenFileDescriptor
    import com.intellij.openapi.fileTypes.FileType
    import com.intellij.openapi.fileTypes.FileTypeRegistry
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/checkin/PijulCheckingEnvironment.kt at line 26
    [2.9553]
    [2.9553]
    import com.intellij.openapi.wm.WindowManager
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/checkin/PijulCheckingEnvironment.kt at line 41
    [2.10014]
    [2.10014]
    import com.intellij.ui.EditorTextField
    import com.intellij.psi.PsiDocumentManager
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/checkin/PijulCheckingEnvironment.kt at line 45
    [2.10015]
    [2.10015]
    import com.intellij.psi.PsiElement
    import com.intellij.psi.PsiFile
    import com.intellij.testFramework.LightVirtualFile
  • edit in src/main/kotlin/com/github/jonathanxd/dracon/checkin/PijulCheckingEnvironment.kt at line 98
    [2.11787][2.11787:11810]()
    println(paths)
  • edit in build.gradle.kts at line 64
    [4.15459]
    [4.15459]
    setPlugins("org.toml.lang:0.2.144.3766-211")
  • edit in build.gradle.kts at line 103
    [4.28689]
    [4.28689]
    excludes.add("**/plugin.xml")