" sh 'echo stuff >> unversioned; wc -l unversioned'\n" +
" }\n" +
" sh 'for f in */*; do echo PRESENT: $f; done'\n" +
" }\n" +
"}"));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
r.assertLogContains("PRESENT: main/file", b);
r.assertLogContains("PRESENT: other/otherfile", b);
r.assertLogContains("1 unversioned", b);
FileUtils.touch(new File(sampleRepo, "file2"));
hg(sampleRepo, "add", "file2");
hg(sampleRepo, "commit", "--message=file2");
FileUtils.touch(new File(otherRepo, "otherfile2"));
hg(otherRepo, "add", "otherfile2");
hg(otherRepo, "commit", "--message=otherfile2");
System.out.println(r.createWebClient().goTo("mercurial/notifyCommit?url=" + URLEncoder.encode(sampleRepo.getAbsolutePath(), "UTF-8"), "text/plain").getWebResponse().getContentAsString());
System.out.println(r.createWebClient().goTo("mercurial/notifyCommit?url=" + URLEncoder.encode(otherRepo.getAbsolutePath(), "UTF-8"), "text/plain").getWebResponse().getContentAsString());
r.waitUntilNoActivity();
FileUtils.copyFile(p.getSCMTrigger().getLogFile(), System.out);
b = p.getLastBuild();
assertEquals(2, b.number);
r.assertLogContains("PRESENT: main/file2", b);
r.assertLogContains("PRESENT: other/otherfile2", b);
r.assertLogContains("1 unversioned", b);
Iterator<? extends SCM> scms = p.getSCMs().iterator();
assertTrue(scms.hasNext());
assertEquals(sampleRepo.getAbsolutePath(), ((MercurialSCM) scms.next()).getSource());
assertTrue(scms.hasNext());
assertEquals(otherRepo.getAbsolutePath(), ((MercurialSCM) scms.next()).getSource());
assertFalse(scms.hasNext());
List<ChangeLogSet<? extends ChangeLogSet.Entry>> changeSets = b.getChangeSets();
assertEquals(2, changeSets.size());
ChangeLogSet<? extends ChangeLogSet.Entry> changeSet = changeSets.get(0);
assertEquals(b, changeSet.getRun());
assertEquals("hg", changeSet.getKind());
Iterator<? extends ChangeLogSet.Entry> iterator = changeSet.iterator();