void () { cd(myRepository); touch("A.txt", "dsfdfdsf"); hg("add A.txt"); touch("B.txt"); hg("add B.txt"); hg("commit -m 2files_added"); File dirFile = mkdir("dir"); cd("dir"); touch("C.txt"); touch("D.txt"); hg("add C.txt"); hg("add D.txt"); hg("commit -m createDir"); String[] hash1 = hg("log -l 1 --template=" + SHORT_TEMPLATE_REVISION).split(":"); HgRevisionNumber r1number = HgRevisionNumber.getInstance(hash1[0], hash1[1]); HgFileRevision rev1 = new HgFileRevision(myProject, new HgFile(myRepository, dirFile), r1number, "", null, "", "", null, null, null, null); echo("C.txt", "aaaa"); echo("D.txt", "dddd"); hg("commit -m modifyDir"); String[] hash2 = hg("log -l 1 --template=" + SHORT_TEMPLATE_REVISION).split(":"); HgRevisionNumber r2number = HgRevisionNumber.getInstance(hash2[0], hash2[1]); HgFileRevision rev2 = new HgFileRevision(myProject, new HgFile(myRepository, dirFile), r2number, "", null, "", "", null, null, null, null); FilePath dirPath = VcsUtil.getFilePath(dirFile, true); List<Change> changes = HgUtil.getDiff(myProject, myRepository, dirPath, rev1.getRevisionNumber(), rev2.getRevisionNumber()); assertEquals(2, changes.size()); }