From bfa074babe02995f88df7374152e75c0cb9c8d07 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Mon, 16 Apr 2018 18:20:04 +0300 Subject: [PATCH] [vcs-log] fix recreating log after reloading mappings from disk When vcs mappings are changed on disk, ProjectLevelVcsManager.readDirectoryMappings first clears the old mappings completely. This triggers VCS_CONFIGURATION_CHANGED event. Then new mappings are set, which triggers the event again. So recreateLog is called twice, the first time it just disposes the old log, the second it should create a new one. The issue was that the callback creating a new log was only called if an old log was present (after disposing it). Which led to new log not being created. Fix is to always invoke the callback. --- .../impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java index 2d0ede6e75b0..f67a495ac4e1 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java @@ -180,8 +180,11 @@ public class VcsProjectLog implements Disposable { if (myValue != null) { myMessageBus.syncPublisher(VCS_PROJECT_LOG_CHANGED).logDisposed(myValue); myValue.dispose(callback); + myValue = null; + } + else if (callback != null) { + ApplicationManager.getApplication().executeOnPooledThread(callback); } - myValue = null; } @Nullable