}
@Test
public void testSimple() throws Exception {
int x = 0;
HgLookup lookup = new HgLookup();
for (HgRemoteRepository hgRemote : Configuration.get().allRemote()) {
File dest = RepoUtils.initEmptyTempRepo("test-incoming-" + x++);
HgRepository localRepo = lookup.detect(dest);
// Idea:
// hg in, hg4j in, compare
// hg pull total/2
// hg in, hg4j in, compare
List<Nodeid> incoming = runAndCompareIncoming(localRepo, hgRemote);
Assert.assertTrue("Need remote repository of reasonable size to test incoming command for partially filled case", incoming.size() >= 5);
//
Nodeid median = incoming.get(incoming.size() / 2);
System.out.println("About to pull up to revision " + median.shortNotation());
new ExecHelper(new OutputParser.Stub(), dest).run("hg", "pull", "-r", median.toString(), hgRemote.getLocation());
//
// shall re-read repository to pull up new changes
localRepo = lookup.detect(dest);
runAndCompareIncoming(localRepo, hgRemote);
}
}