FilePath (@NotNull FilePath filePath, ChangeListManager changeListManager) { Change change = changeListManager.getChange(filePath); if (change == null) { return filePath; } FileStatus status = change.getFileStatus(); if (status == HgChangeProvider.COPIED || status == HgChangeProvider.RENAMED) { ContentRevision beforeRevision = change.getBeforeRevision(); assert beforeRevision != null : "If a file's status is copied or renamed, there must be an previous version"; return beforeRevision.getFile(); } else { return filePath; } }