Change (@NotNull Project project, @NotNull VirtualFile root, @Nullable String fileBefore, @Nullable HgRevisionNumber revisionBefore, @Nullable String fileAfter, HgRevisionNumber revisionAfter, FileStatus aStatus) { HgContentRevision beforeRevision = fileBefore == null || aStatus == FileStatus.ADDED ? null : HgContentRevision .create(project, new HgFile(root, new File(root.getPath(), fileBefore)), revisionBefore); ContentRevision afterRevision; if (aStatus == FileStatus.DELETED) { afterRevision = null; } else if (revisionAfter == null && fileBefore != null) { afterRevision = CurrentContentRevision.create(new HgFile(root, new File(root.getPath(), fileAfter != null ? fileAfter : fileBefore)).toFilePath()); } else { assert revisionAfter != null; afterRevision = fileAfter == null ? null : HgContentRevision.create(project, new HgFile(root, new File(root.getPath(), fileAfter)), revisionAfter); } return new Change(beforeRevision, afterRevision, aStatus); }