HgCommitCommand cmd = new HgCommitCommand(hgRepo);
assertFalse(cmd.isMergeCommit());
Outcome r = cmd.message("FIRST").execute();
errorCollector.assertTrue(r.isOk());
Nodeid c1 = cmd.getCommittedRevision();
// check that modified files are no longer reported as such
TestStatus.StatusCollector status = new TestStatus.StatusCollector();
new HgStatusCommand(hgRepo).all().execute(status);
errorCollector.assertTrue(status.getErrors().isEmpty());
errorCollector.assertTrue(status.get(Kind.Modified).isEmpty());
errorCollector.assertEquals(1, status.get(dfB.getPath()).size());
errorCollector.assertTrue(status.get(dfB.getPath()).contains(Kind.Clean));
HgDataFile dfD = hgRepo.getFileNode("d");
assertTrue("[sanity]", dfD.exists());
File fileD = new File(repoLoc, "d");
assertTrue("[sanity]", fileD.canRead());
//
RepoUtils.modifyFileAppend(fileD, " 1 \n");
cmd = new HgCommitCommand(hgRepo);
assertFalse(cmd.isMergeCommit());
r = cmd.message("SECOND").execute();
errorCollector.assertTrue(r.isOk());
Nodeid c2 = cmd.getCommittedRevision();
//
errorCollector.assertEquals("SECOND", hgRepo.getCommitLastMessage());
//
int lastRev = hgRepo.getChangelog().getLastRevision();
List<HgChangeset> csets = new HgLogCommand(hgRepo).range(lastRev-1, lastRev).execute();