From c6bc09a938b16bbf43cbffa9df3d937dac2e85a4 Mon Sep 17 00:00:00 2001 From: Nikolay Rykunov Date: Thu, 24 Oct 2019 16:14:48 +0300 Subject: [PATCH] [git] Use DiffEditorTitleCustomizer instead of simple titles in GitDefaultMergeDialogCustomizer GitOrigin-RevId: a19a62d19f54a61dcc5ba4f5d20050a547599c05 --- .../merge/GitDefaultMergeDialogCustomizer.kt | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/plugins/git4idea/src/git4idea/merge/GitDefaultMergeDialogCustomizer.kt b/plugins/git4idea/src/git4idea/merge/GitDefaultMergeDialogCustomizer.kt index 9368b3d23c66..3a5cc8bd832a 100644 --- a/plugins/git4idea/src/git4idea/merge/GitDefaultMergeDialogCustomizer.kt +++ b/plugins/git4idea/src/git4idea/merge/GitDefaultMergeDialogCustomizer.kt @@ -13,7 +13,6 @@ import com.intellij.openapi.vcs.VcsException import com.intellij.openapi.vcs.changes.Change import com.intellij.openapi.vcs.changes.committed.CommittedChangesTreeBrowser import com.intellij.openapi.vcs.changes.ui.ChangeListViewerDialog -import com.intellij.openapi.vcs.history.VcsRevisionNumber import com.intellij.openapi.vcs.merge.MergeDialogCustomizer import com.intellij.openapi.vfs.VirtualFile import com.intellij.ui.components.JBCheckBox @@ -91,38 +90,6 @@ open class GitDefaultMergeDialogCustomizer( return super.getMultipleFileMergeDescription(files) } - override fun getLeftPanelTitle(file: VirtualFile): String { - val currentBranch = GitRepositoryManager.getInstance(project).getRepositoryForFile(file)?.currentBranchName - return if (currentBranch != null) getDefaultLeftPanelTitleForBranch(currentBranch) - else super.getLeftPanelTitle(file) - } - - override fun getRightPanelTitle(file: VirtualFile, revisionNumber: VcsRevisionNumber?): String { - val repository = GitRepositoryManager.getInstance(project).getRepositoryForFile(file) - ?: return super.getRightPanelTitle(file, revisionNumber) - - val branchBeingMerged = resolveMergeBranch(repository) ?: resolveRebaseOntoBranch(repository) - if (branchBeingMerged != null) { - return getDefaultRightPanelTitleForBranch(branchBeingMerged.branchName, branchBeingMerged.hash) - } - - val cherryPickHead = try { - GitRevisionNumber.resolve(project, repository.root, CHERRY_PICK_HEAD) - } - catch (e: VcsException) { - null - } - - if (cherryPickHead != null) { - return "Changes from cherry-pick ${cherryPickHead.shortRev}" - } - - if (revisionNumber is GitRevisionNumber) { - return DiffBundle.message("merge.version.title.their.with.revision", revisionNumber.shortRev) - } - return super.getRightPanelTitle(file, revisionNumber) - } - override fun getTitleCustomizerList(file: FilePath): DiffEditorTitleCustomizerList { val repository = GitRepositoryManager.getInstance(project).getRepositoryForFile(file) ?: return DEFAULT_CUSTOMIZER_LIST return when (repository.state) {