Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #18 from kmbell/jenkins-12361
Browse files Browse the repository at this point in the history
Fix for JENKINS-12361
  • Loading branch information
jglick committed Jan 13, 2012
2 parents b259bfe + f53ffd9 commit ab0aa6c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/hudson/plugins/mercurial/MercurialSCM.java
Expand Up @@ -325,8 +325,9 @@ private Set<String> dependentChanges(Set<String> changedFileNames) {
Set<String> affecting = new HashSet<String>();

for (String changedFile : changedFileNames) {
String unixChangedFile = changedFile.replace('\\', '/');
for (String dependency : _modules) {
if (changedFile.startsWith(dependency)) {
if (unixChangedFile.startsWith(dependency)) {
affecting.add(changedFile);
break;
}
Expand Down
19 changes: 19 additions & 0 deletions src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java
Expand Up @@ -143,6 +143,25 @@ public void testPollingLimitedToModules2() throws Exception {
buildAndCheck(p, "dir1/f");
}

@Bug(12361)
public void testPollingLimitedToModules3() throws Exception {
PollingResult pr;
FreeStyleProject p = createFreeStyleProject();
p.setScm(new MercurialSCM(hgInstallation, repo.getPath(), null, "dir1/f",
null, null, false));
hg(repo, "init");
touchAndCommit(repo, "starter");
pollSCMChanges(p);
buildAndCheck(p, "starter");
touchAndCommit(repo, "dir1/g");
pr = pollSCMChanges(p);
assertEquals(PollingResult.Change.INSIGNIFICANT, pr.change);
touchAndCommit(repo, "dir1/f");
pr = pollSCMChanges(p);
assertEquals(PollingResult.Change.SIGNIFICANT, pr.change);
buildAndCheck(p, "dir1/f");
}

public void testParseStatus() throws Exception {
assertEquals(new HashSet<String>(Arrays.asList("whatever", "added", "mo-re", "whatever-c", "initial", "more")), MercurialSCM.parseStatus(
"M whatever\n"
Expand Down

0 comments on commit ab0aa6c

Please sign in to comment.