File dest = RepoUtils.createEmptyDir("test-outgoing-" + x++);
ExecHelper eh0 = new ExecHelper(new OutputParser.Stub(false), null);
eh0.run("hg", "clone", hgRemote.getLocation(), dest.toString());
eh0.cwd(dest);
Assert.assertEquals("initial clone failed", 0, eh0.getExitValue());
HgOutgoingCommand cmd = new HgOutgoingCommand(lookup.detect(dest)).against(hgRemote);
LogOutputParser outParser = new LogOutputParser(true);
ExecHelper eh = new ExecHelper(outParser, dest);
HgLogCommand.CollectHandler collector = new HgLogCommand.CollectHandler();
//
cmd.executeFull(collector);
List<Nodeid> liteResult = cmd.executeLite();
eh.run("hg", "outgoing", "--debug", hgRemote.getLocation());
TestIncoming.report(collector, outParser, liteResult, errorCollector);
//
File f = new File(dest, "Test.txt");
RepoUtils.createFile(f, "1");
eh0.run("hg", "add");
eh0.run("hg", "commit", "-m", "1");
RepoUtils.modifyFileAppend(f, "2");
eh0.run("hg", "commit", "-m", "2");
//
cmd = new HgOutgoingCommand(lookup.detect(dest)).against(hgRemote);
cmd.executeFull(collector = new HgLogCommand.CollectHandler());
liteResult = cmd.executeLite();
outParser.reset();
eh.run("hg", "outgoing", "--debug", hgRemote.getLocation());
TestIncoming.report(collector, outParser, liteResult, errorCollector);
}
}