[file-history, hg] return repository current revision for directories

Asking for a directory specifically returns null, which breaks actions such as "Compare with Local".

Change was made in a37c643781 in order to reuse calcCurrentRevisionNumber in VcsCachingHistory instead of calling a diff provider. But that was not actually necessary, since mercurial file history does not use cache at all.

IDEA-196914
This commit is contained in:
Julia Beliaeva
2018-08-16 22:27:22 +03:00
parent eb6b10e7ec
commit 9eb47d0ffb
@@ -111,6 +111,7 @@ public class HgHistoryProvider implements VcsHistoryProvider {
@Override
@Nullable
protected VcsRevisionNumber calcCurrentRevisionNumber() {
if (filePath.isDirectory()) return new HgWorkingCopyRevisionsCommand(myProject).firstParent(vcsRoot);
return new HgWorkingCopyRevisionsCommand(myProject).parents(vcsRoot, filePath).first;
}