From 02ec1b8fad263f43d40f32b08ffa15b3ba1ca09f Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Mon, 28 Feb 2011 12:58:23 +0300 Subject: [PATCH] IDEA-64198 selective push fix When initial fetch completes, don't nullify unchecked commits. Instead retrieve them from the dialog. ed9f81b introduced this bug: tree was completely refreshed after background fetch, thus information about some commits deselected by user was lost. --- .../checkin/GitPushActiveBranchesDialog.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/git4idea/src/git4idea/checkin/GitPushActiveBranchesDialog.java b/plugins/git4idea/src/git4idea/checkin/GitPushActiveBranchesDialog.java index a6c573d3ea83..f7a81b095b57 100644 --- a/plugins/git4idea/src/git4idea/checkin/GitPushActiveBranchesDialog.java +++ b/plugins/git4idea/src/git4idea/checkin/GitPushActiveBranchesDialog.java @@ -524,16 +524,23 @@ public class GitPushActiveBranchesDialog extends DialogWrapper { * * @param fetchData if true, the current state is fetched from remote * @param unchecked the map from vcs root to commit identifiers that should be unchecked - * @param initial set this true if refreshTree is called for the first time - during the dialog construction. - * the difference is that commit checkboxes should be checked only during the initial refresh - others should respect - * user who could uncheck some commits. + * @param updateCommits if true, then the specified unchecked commits should be used for building tree. + * if false, then unchecked are ignored and values are retrieved from the dialog. + * The latter is used for initial refresh which may finish after user has deselected some commits. */ - private void refreshTree(final boolean fetchData, final Map> unchecked, final boolean updateUncheckedCommits) { + private void refreshTree(final boolean fetchData, final Map> unchecked, final boolean updateCommits) { myCommitTree.setPaintBusy(true); loadRootsInBackground(fetchData, new PushActiveBranchRunnable(){ @Override void run(List roots) { - updateTree(roots, updateUncheckedCommits ? unchecked : null); + Map> uncheckedCommits; + if (!updateCommits) { + RebaseInfo info = collectRebaseInfo(); + uncheckedCommits = info.uncheckedCommits; + } else { + uncheckedCommits = unchecked; + } + updateTree(roots, uncheckedCommits); updateUI(); myCommitTree.setPaintBusy(false); }