List<Change> (final @NotNull Project project, final @NotNull VirtualFile root, final @NotNull FilePath path, final @Nullable HgRevisionNumber revNum1, final @Nullable HgRevisionNumber revNum2) { HgStatusCommand statusCommand; if (revNum1 != null) { //rev2==null means "compare with local version" statusCommand = new HgStatusCommand.Builder(true).ignored(false).unknown(false).copySource(!path.isDirectory()).baseRevision(revNum1) .targetRevision(revNum2).build(project); } else { LOG.assertTrue(revNum2 != null, "revision1 and revision2 can't both be null. Path: " + path); //rev1 and rev2 can't be null both// //get initial changes// statusCommand = new HgStatusCommand.Builder(true).ignored(false).unknown(false).copySource(false).baseRevision(revNum2) .build(project); } Collection<HgChange> hgChanges = statusCommand.executeInCurrentThread(root, Collections.singleton(path)); return createChanges(project, root, revNum1, revNum2, hgChanges); }