From af905259e4206f5bae3f9cc91708d3e3474b1864 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Sun, 19 Nov 2017 16:48:30 +0300 Subject: [PATCH] git tests: add debug logs for test failures "no changelist for conflicts created" --- plugins/git4idea/src/git4idea/GitApplyChangesProcess.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/git4idea/src/git4idea/GitApplyChangesProcess.kt b/plugins/git4idea/src/git4idea/GitApplyChangesProcess.kt index dfea90a55a48..cff5a2493d5a 100644 --- a/plugins/git4idea/src/git4idea/GitApplyChangesProcess.kt +++ b/plugins/git4idea/src/git4idea/GitApplyChangesProcess.kt @@ -199,8 +199,7 @@ class GitApplyChangesProcess(private val project: Project, } val changes = actualList.changes if (changes.isEmpty()) { - val changesString = changeListManager.changeLists.map { it -> "[${it.name}] ${it.changes}" } - LOG.debug("No changes in the $actualList. All changes in the CLM: $changesString") + LOG.debug("No changes in the $actualList. All changes in the CLM: ${getAllChangesInLogFriendlyPresentation(changeListManager)}") alreadyPicked.add(commit) return true } @@ -220,6 +219,9 @@ class GitApplyChangesProcess(private val project: Project, } } + private fun getAllChangesInLogFriendlyPresentation(changeListManagerEx: ChangeListManagerEx) = + changeListManagerEx.changeLists.map { it -> "[${it.name}] ${it.changes}" } + private fun waitForChangeListManagerUpdate() { val waiter = CountDownLatch(1) changeListManager.invokeAfterUpdate({ @@ -252,7 +254,8 @@ class GitApplyChangesProcess(private val project: Project, private fun removeChangeListIfEmpty(changeList: LocalChangeList) { val actualList = changeListManager.getChangeList(changeList.id) if (actualList != null && actualList.changes.isEmpty()) { - LOG.debug("Changelist $actualList is empty, removing.") + LOG.debug("Changelist $actualList is empty, removing. " + + "All changes in the CLM: ${getAllChangesInLogFriendlyPresentation(changeListManager)}") changeListManager.removeChangeList(actualList) } }