@Override
  public @NotNull Collection<Change> compareWithWorkingDir(@NotNull VirtualFile fileOrDir,
                                                           @NotNull VcsRevisionNumber revNum) throws VcsException {

    final HgRepository repo = HgUtil.getRepositoryManager(project).getRepositoryForFile(fileOrDir);
    if (repo == null) {
      throw new VcsException(HgBundle.message("error.cannot.find.repository.for.file", fileOrDir.getName()));
    }
    assert revNum instanceof HgRevisionNumber : "Expected " + HgRevisionNumber.class.getSimpleName()
                                                + ", got " + revNum.getClass().getSimpleName();
    FilePath filePath = VcsUtil.getFilePath(fileOrDir);
    final List<Change> changes = HgUtil.getDiff(project, repo.getRoot(), filePath, (HgRevisionNumber)revNum, null);
    if (changes.isEmpty() && !filePath.isDirectory()) {
      final HgFile hgFile = new HgFile(repo.getRoot(), filePath);
      return createChangesWithCurrentContentForFile(filePath, HgContentRevision.create(project, hgFile, (HgRevisionNumber)revNum));
    }
    return changes;
  }
@Override
  public @NotNull Collection<Change> compareWithWorkingDir(@NotNull VirtualFile fileOrDir,
                                                           @NotNull VcsRevisionNumber revNum)