VcsRevisionNumber (VirtualFile file) { VirtualFile vcsRoot = VcsUtil.getVcsRootFor(project, file); if (vcsRoot == null) { return null; } FilePath filePath = VcsUtil.getFilePath(file); return new HgWorkingCopyRevisionsCommand(project).parents(vcsRoot, filePath).first; }