public void testCommand() throws Exception {
// get a copy of a repository
File testRepoLoc = RepoUtils.cloneRepoToTempLocation(Configuration.get().find("log-1"), "test-revert", false);
repo = new HgLookup().detect(testRepoLoc);
Path targetFile = Path.create("b");
RepoUtils.modifyFileAppend(new File(testRepoLoc, targetFile.toString()), "XXX");
StatusOutputParser statusParser = new StatusOutputParser();
eh = new ExecHelper(statusParser, testRepoLoc);
eh.run("hg", "status", "-A");
assertEquals("[sanity]", 1, statusParser.getModified().size());
assertEquals("[sanity]", 2, statusParser.getClean().size());
assertEquals("[sanity]", targetFile, statusParser.getModified().get(0));
HgRevertCommand cmd = new HgRevertCommand(repo);
cmd.file(targetFile).execute();
statusParser.reset();
eh.run("hg", "status", "-A");
errorCollector.assertEquals(3, statusParser.getClean().size());
errorCollector.assertTrue(statusParser.getClean().contains(targetFile));
errorCollector.assertEquals(1, statusParser.getUnknown().size());
errorCollector.assertEquals(targetFile.toString() + ".orig", statusParser.getUnknown().get(0).toString());
}