// init empty
HgRepository hgRepo = new HgInitCommand().location(repoLoc).revlogV1().execute();
assertFalse("[sanity]", hgRepo.isInvalid());
assertEquals("[sanity]", 0, hgRepo.getChangelog().getRevisionCount());
// add 2 files
Path fa = Path.create("a"), fb = Path.create("b");
final File fileA = new File(repoLoc, fa.toString());
final File fileB = new File(repoLoc, fb.toString());
RepoUtils.createFile(fileA, "first file");
RepoUtils.createFile(fileB, "second file");
new HgAddRemoveCommand(hgRepo).add(fa, fb).execute();
new HgCommitCommand(hgRepo).message("FIRST").execute();
// add one more file
// remove one initial file
Path fc = Path.create("c");
final File fileC = new File(repoLoc, fc.toString());
RepoUtils.createFile(fileC, "third file");
fileB.delete();
// TODO HgAddRemoveCommand needs #copy(from, to) method
new HgAddRemoveCommand(hgRepo).add(fc).remove(fb).execute();
new HgCommitCommand(hgRepo).message("SECOND").execute();