From 32cbfb19c36b939c5e780d19edc6b3916ca8d720 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Fri, 8 Apr 2011 15:51:53 +0400 Subject: [PATCH] HgHistoryProvider: don't query for current revision for empty history. --- .../org/zmlx/hg4idea/provider/HgHistoryProvider.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java index 7a706efad127..a6690f64f6de 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java @@ -66,7 +66,7 @@ public class HgHistoryProvider implements VcsHistoryProvider { } final List revisions = new ArrayList(); revisions.addAll(getHistory(filePath, vcsRoot, myProject, DEFAULT_LIMIT)); - return createAppendableSession(vcsRoot, revisions); + return createAppendableSession(vcsRoot, revisions, null); } public void reportAppendableHistory(FilePath filePath, final VcsAppendableHistorySessionPartner partner) throws VcsException { @@ -75,7 +75,7 @@ public class HgHistoryProvider implements VcsHistoryProvider { final List history = getHistory(filePath, vcsRoot, myProject, DEFAULT_LIMIT); if (history.size() == 0) return; - final VcsAbstractHistorySession emptySession = createAppendableSession(vcsRoot, Collections.emptyList()); + final VcsAbstractHistorySession emptySession = createAppendableSession(vcsRoot, Collections.emptyList(), null); partner.reportCreatedEmptySession(emptySession); for (HgFileRevision hgFileRevision : history) { @@ -84,8 +84,8 @@ public class HgHistoryProvider implements VcsHistoryProvider { partner.finished(); } - private VcsAbstractHistorySession createAppendableSession(final VirtualFile vcsRoot, List revisions) { - return new VcsAbstractHistorySession(revisions) { + private VcsAbstractHistorySession createAppendableSession(final VirtualFile vcsRoot, List revisions, @Nullable VcsRevisionNumber number) { + return new VcsAbstractHistorySession(revisions, number) { @Nullable protected VcsRevisionNumber calcCurrentRevisionNumber() { return new HgWorkingCopyRevisionsCommand(myProject).firstParent(vcsRoot); @@ -97,7 +97,7 @@ public class HgHistoryProvider implements VcsHistoryProvider { @Override public VcsHistorySession copy() { - return createAppendableSession(vcsRoot, getRevisionList()); + return createAppendableSession(vcsRoot, getRevisionList(), getCurrentRevisionNumber()); } }; }