Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-12162

Mercurial plugin don't honor subdirectory

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After Mercurial Plugin 1.38 drop Forest support, I had to update my OpenJDK 7 build jobs to use multi-scm plugin.

      I created one SCM entry for main and forest subdirs

      Each SCM use its own subdir, ie jdk, jaxp, jaxws, to respect OpenJDK build needs.

      There is a problem with hg log (used for changes detection and collect)

      Started by user anonymous
      Building on master
      $ hg clone --rev default --noupdate http://hg.openjdk.java.net/jdk7u/jdk7u-osx /Volumes/Snow/Documents/jenkins/data/jobs/openjdk-jdk7u-jdk7u-osx/workspace
      adding changesets
      adding manifests
      adding file changes
      added 393 changesets with 382 changes to 33 files
      [workspace] $ hg update --rev default
      32 files updated, 0 files merged, 0 files removed, 0 files unresolved
      [workspace] $ hg log --rev . --template {node}
      [workspace] $ hg log --rev 25457f672756f16fed69a172c602fd9aca087413
      [workspace] $ hg log --template "<changeset node='{node}' author='{author|xmlescape}' rev='{rev}' date='{date}'><msg>{desc|xmlescape}</msg><added>{file_adds|stringify|xmlescape}</added><deleted>{file_dels|stringify|xmlescape}</deleted><files>{files|stringify|xmlescape}</files><parents>{parents}</parents></changeset>\n" --rev default:0 --follow --prune 25457f672756f16fed69a172c602fd9aca087413
      $ hg clone --rev default --noupdate http://hg.openjdk.java.net/jdk7u/jdk7u-osx/jdk /Volumes/Snow/Documents/jenkins/data/jobs/openjdk-jdk7u-jdk7u-osx/workspace/jdk
      adding changesets
      adding manifests
      adding file changes
      added 4550 changesets with 58341 changes to 21221 files
      [jdk] $ hg update --rev default
      20095 files updated, 0 files merged, 0 files removed, 0 files unresolved
      [jdk] $ hg log --rev . --template {node}
      [jdk] $ hg log --rev 25457f672756f16fed69a172c602fd9aca087413
      ERROR: Previous built revision 25457f672756f16fed69a172c602fd9aca087413 is not know in this clone; unable to determine change log
      $ hg clone --rev default --noupdate http://hg.openjdk.java.net/jdk7u/jdk7u-osx/corba /Volumes/Snow/Documents/jenkins/data/jobs/openjdk-jdk7u-jdk7u-osx/workspace/corba
      adding changesets
      adding manifests
      adding file changes
      added 331 changesets with 3242 changes to 1379 files
      [corba] $ hg update --rev default
      1358 files updated, 0 files merged, 0 files removed, 0 files unresolved
      [corba] $ hg log --rev . --template {node}
      [corba] $ hg log --rev 25457f672756f16fed69a172c602fd9aca087413
      ERROR: Previous built revision 25457f672756f16fed69a172c602fd9aca087413 is not know in this clone; unable to determine change log
      $ hg clone --rev default --noupdate http://hg.openjdk.java.net/jdk7u/jdk7u-osx/hotspot /Volumes/Snow/Documents/jenkins/data/jobs/openjdk-jdk7u-jdk7u-osx/workspace/hotspot
      adding changesets
      adding manifests
      adding file changes
      added 2928 changesets with 22482 changes to 4374 files
      [hotspot] $ hg update --rev default
      4006 files updated, 0 files merged, 0 files removed, 0 files unresolved
      [hotspot] $ hg log --rev . --template {node}
      [hotspot] $ hg log --rev 25457f672756f16fed69a172c602fd9aca087413
      ERROR: Previous built revision 25457f672756f16fed69a172c602fd9aca087413 is not know in this clone; unable to determine change log
      $ hg clone --rev default --noupdate http://hg.openjdk.java.net/jdk7u/jdk7u-osx/jaxp /Volumes/Snow/Documents/jenkins/data/jobs/openjdk-jdk7u-jdk7u-osx/workspace/jaxp
      adding changesets
      adding manifests
      adding file changes
      added 284 changesets with 2254 changes to 1984 files
      [jaxp] $ hg update --rev default
      19 files updated, 0 files merged, 0 files removed, 0 files unresolved
      [jaxp] $ hg log --rev . --template {node}
      [jaxp] $ hg log --rev 25457f672756f16fed69a172c602fd9aca087413
      ERROR: Previous built revision 25457f672756f16fed69a172c602fd9aca087413 is not know in this clone; unable to determine change log
      $ hg clone --rev default --noupdate http://hg.openjdk.java.net/jdk7u/jdk7u-osx/jaxws /Volumes/Snow/Documents/jenkins/data/jobs/openjdk-jdk7u-jdk7u-osx/workspace/jaxws
      adding changesets
      adding manifests
      adding file changes
      added 274 changesets with 6488 changes to 3002 files
      [jaxws] $ hg update --rev default
      19 files updated, 0 files merged, 0 files removed, 0 files unresolved
      [jaxws] $ hg log --rev . --template {node}
      [jaxws] $ hg log --rev 25457f672756f16fed69a172c602fd9aca087413
      ERROR: Previous built revision 25457f672756f16fed69a172c602fd9aca087413 is not know in this clone; unable to determine change log
      [jdk] $ hg showconfig paths.default
      [jdk] $ hg pull --rev default
      [jdk] $ hg update --clean --rev default
      0 files updated, 0 files merged, 0 files removed, 0 files unresolved
      [jdk] $ hg --config extensions.purge= clean --all
      [jdk] $ hg log --rev . --template {node}
      [jdk] $ hg log --rev 25457f672756f16fed69a172c602fd9aca087413
      ERROR: Previous built revision 25457f672756f16fed69a172c602fd9aca087413 is not know in this clone; unable to determine change log
      $ hg clone --rev default --noupdate http://hg.openjdk.java.net/jdk7u/jdk7u-osx/langtools /Volumes/Snow/Documents/jenkins/data/jobs/openjdk-jdk7u-jdk7u-osx/workspace/langtools
      adding changesets
      adding manifests
      adding file changes
      added 1119 changesets with 13084 changes to 4744 files
      [langtools] $ hg update --rev default
      4405 files updated, 0 files merged, 0 files removed, 0 files unresolved
      [langtools] $ hg log --rev . --template {node}
      [langtools] $ hg log --rev 25457f672756f16fed69a172c602fd9aca087413
      ERROR: Previous built revision 25457f672756f16fed69a172c602fd9aca087413 is not know in this clone; unable to determine change log
      [workspace] $ /bin/sh /Volumes/Snow/Documents/jenkins/tomcat7/temp/hudson6954119360602177632.sh
      

      It seems hg log didn't respect specified subdir and is done on main directory instead of SCM subdirectory

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            According to the log snippet, the subdirectory (in square brackets) is correct. The problem rather seems to be that the base revision is being copied from the top repo. I think the bug is that MercurialSCM calls previousBuild.getAction(MercurialTagAction.class) which is nonsense when there are multiple copies of the SCM in the job; it needs to use previousBuild.getActions() and find the right one. That in turn means that MercurialTagAction needs to save subdir.

            Show
            jglick Jesse Glick added a comment - According to the log snippet, the subdirectory (in square brackets) is correct. The problem rather seems to be that the base revision is being copied from the top repo. I think the bug is that MercurialSCM calls previousBuild.getAction(MercurialTagAction.class) which is nonsense when there are multiple copies of the SCM in the job; it needs to use previousBuild.getActions() and find the right one. That in turn means that MercurialTagAction needs to save subdir .
            Hide
            hgomez Henri Gomez added a comment -

            Thanks for feedback.

            So no way to fix it by configuration trick for now ?

            Show
            hgomez Henri Gomez added a comment - Thanks for feedback. So no way to fix it by configuration trick for now ?
            Hide
            jglick Jesse Glick added a comment -

            c148799 probably broke multiscm usage. Prior to that (e.g. in 1.37) polling was done using hg incoming in each subdirectory, which works fine with multiscm as far as I know. So until this is fixed I would recommend you simply downgrade to 1.37 (but still use multiscm rather than Forest).

            Show
            jglick Jesse Glick added a comment - c148799 probably broke multiscm usage. Prior to that (e.g. in 1.37) polling was done using hg incoming in each subdirectory, which works fine with multiscm as far as I know. So until this is fixed I would recommend you simply downgrade to 1.37 (but still use multiscm rather than Forest).
            Hide
            jglick Jesse Glick added a comment -

            Correction: it is changelog calculation, not polling, that got broken.

            Show
            jglick Jesse Glick added a comment - Correction: it is changelog calculation, not polling, that got broken.
            Hide
            jglick Jesse Glick added a comment -

            Note that polling will not work without a fix for JENKINS-12298.

            Show
            jglick Jesse Glick added a comment - Note that polling will not work without a fix for JENKINS-12298 .
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/hudson/plugins/mercurial/MercurialSCM.java
            src/main/java/hudson/plugins/mercurial/MercurialTagAction.java
            src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java
            src/test/java/hudson/plugins/mercurial/MultiSCM.java
            src/test/java/hudson/plugins/mercurial/MultiSCMChangeLogParser.java
            src/test/java/hudson/plugins/mercurial/MultiSCMChangeLogSet.java
            http://jenkins-ci.org/commit/mercurial-plugin/022276b99683d23ccc72afd2c78ce28e4af01ef9
            Log:
            [FIXED JENKINS-12162] Mercurial plugin does not honor subdirectory.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/main/java/hudson/plugins/mercurial/MercurialTagAction.java src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java src/test/java/hudson/plugins/mercurial/MultiSCM.java src/test/java/hudson/plugins/mercurial/MultiSCMChangeLogParser.java src/test/java/hudson/plugins/mercurial/MultiSCMChangeLogSet.java http://jenkins-ci.org/commit/mercurial-plugin/022276b99683d23ccc72afd2c78ce28e4af01ef9 Log: [FIXED JENKINS-12162] Mercurial plugin does not honor subdirectory.
            Hide
            dogfood dogfood added a comment -

            Integrated in plugins_mercurial #85
            [FIXED JENKINS-12162] Mercurial plugin does not honor subdirectory.

            Jesse Glick :
            Files :

            • src/test/java/hudson/plugins/mercurial/MultiSCMChangeLogSet.java
            • src/test/java/hudson/plugins/mercurial/MultiSCM.java
            • src/main/java/hudson/plugins/mercurial/MercurialTagAction.java
            • src/main/java/hudson/plugins/mercurial/MercurialSCM.java
            • src/test/java/hudson/plugins/mercurial/MultiSCMChangeLogParser.java
            • src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java
            Show
            dogfood dogfood added a comment - Integrated in plugins_mercurial #85 [FIXED JENKINS-12162] Mercurial plugin does not honor subdirectory. Jesse Glick : Files : src/test/java/hudson/plugins/mercurial/MultiSCMChangeLogSet.java src/test/java/hudson/plugins/mercurial/MultiSCM.java src/main/java/hudson/plugins/mercurial/MercurialTagAction.java src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/test/java/hudson/plugins/mercurial/MultiSCMChangeLogParser.java src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                hgomez Henri Gomez
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: