void () { cd(myRepository); VirtualFile subDir = myRepository.findFileByRelativePath(subDirName); assert subDir != null; cd(subDir); int namesSize = names.length; String beforeName = names[namesSize - 1]; VirtualFile before = VfsUtil.findFileByIoFile(new File(subDir.getPath(), beforeName), true); assert before != null; final String renamed = "renamed"; hg("mv " + beforeName + " " + renamed); myRepository.refresh(false, true); VirtualFile renamedFile = VfsUtil.findFileByIoFile(new File(subDir.getPath(), renamed), true); assert renamedFile != null; changeListManager.ensureUpToDate(); List<HgFileRevision> revisions = HgHistoryProvider.getHistory(VcsUtil.getFilePath(renamedFile), myRepository, myProject); assertEquals(3, revisions.size()); }