diff options
author | Stefan Lay | 2011-03-01 21:27:39 +0000 |
---|---|---|
committer | Matthias Sohn | 2011-03-01 21:27:39 +0000 |
commit | 5885d0ac6159a29abbf63475e19ccfc184b77d48 (patch) | |
tree | 262aaa2de74b2931c1c7e81e256a5d44ada3bef7 /org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java | |
parent | be36397a1808e581d5420ba31a09874a4a531475 (diff) | |
download | egit-5885d0ac6159a29abbf63475e19ccfc184b77d48.tar.gz egit-5885d0ac6159a29abbf63475e19ccfc184b77d48.tar.xz egit-5885d0ac6159a29abbf63475e19ccfc184b77d48.zip |
[historyView] Fix redraw bug with Show all Branches
Change-Id: If709597fa5726e230d591b474b07eeca03fd5bc3
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java')
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java index e575498c06..afe37b4559 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java @@ -473,6 +473,8 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener { /** Repository of the last input*/ private Repository currentRepo; + private boolean currentShowAllBranches; + /** * Highlight flag that can be applied to commits to make them stand out. * <p> @@ -1199,16 +1201,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener { List<String> paths = buildFilterPaths(input.getItems(), input .getFileList(), db); - boolean pathChange = pathChange(pathFilters, paths); - boolean headChange = !headId.equals(currentHeadId); - boolean repoChange = false; - if (!db.equals(currentRepo)) - { - repoChange = true; - currentRepo = db; - } - if (forceNewWalk || pathChange - || currentWalk == null || headChange || repoChange) { + if (forceNewWalk || shouldRedraw(db, headId, paths)) { // TODO Do not dispose SWTWalk just because HEAD changed // In theory we should be able to update the graph and // not dispose of the SWTWalk, even if HEAD was reset to @@ -1232,6 +1225,25 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener { } } + private boolean shouldRedraw(Repository db, AnyObjectId headId, List<String> paths) { + boolean pathChanged = pathChanged(pathFilters, paths); + boolean headChanged = !headId.equals(currentHeadId); + boolean repoChanged = false; + + boolean allBranchesChanged = currentShowAllBranches != store + .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); + currentShowAllBranches = store + .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); + + if (!db.equals(currentRepo)) { + repoChanged = true; + currentRepo = db; + } + + return pathChanged + || currentWalk == null || headChanged || repoChanged || allBranchesChanged; + } + private AnyObjectId resolveHead(Repository db, boolean acceptNull) { AnyObjectId headId; try { @@ -1325,7 +1337,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener { return paths; } - private boolean pathChange(final List<String> o, final List<String> n) { + private boolean pathChanged(final List<String> o, final List<String> n) { if (o == null) return !n.isEmpty(); return !o.equals(n); |