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

Cannot restrict changesets to subdirectories

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: mercurial-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All

      Description

      I'm evaluating mercurial and hudson as an alternative to clearcase and
      cruisecontrol. Perhaps I don't understand the best way to structure my Mercurial
      repository, but I'd like to create our entire source tree as a single Mercurial
      repository. This means that we'll have 10 or 12 hudson jobs to build all the
      various projects in our source tree. However, it looks like the mercurial plugin
      does an "hg clone" for each job, thus copying the entire source tree for each
      job, which is overkill for us. Additionally, the "hg incoming" line that detects
      changes will notice changes in unrelated projects and trigger a build. I didn't
      see any way to avoid this. This seems like a limitation of the Hudson Mercurial
      plugin to me, so I'm opening an enhancement request here.

      The way we've handled this with cruisecontrol is to list all the directories
      that need to be monitored for changes for a particular project. It seems like
      Hudson could do the same, and perhaps only clone those directories, as well.

        Activity

        Hide
        jglick Jesse Glick added a comment -

        You cannot (currently) clone part of a repository with Mercurial.

        Show
        jglick Jesse Glick added a comment - You cannot (currently) clone part of a repository with Mercurial.
        Hide
        freespirit freespirit added a comment -

        Even if the mercurial plugin clones the whole repo (mercurial limitation not plugin), the plug does have
        support for filtering the changes that trigger a build per directory ...

        Show
        freespirit freespirit added a comment - Even if the mercurial plugin clones the whole repo (mercurial limitation not plugin), the plug does have support for filtering the changes that trigger a build per directory ...
        Hide
        aldobrucale aldobrucale added a comment -

        The "modules" field should do this, but doesn't seem to work - not consistently,
        at least.

        Show
        aldobrucale aldobrucale added a comment - The "modules" field should do this, but doesn't seem to work - not consistently, at least.
        Hide
        jglick Jesse Glick added a comment -

        "the mercurial plugin does an hg clone for each job" - it should clone the first
        time, use update thereafter.

        Polling pays attention to the "Modules" field. If all changesets mention only
        files not present in this list, no build is triggered. If and when a build is
        run (because of polling or for any other reason), all changesets are pulled and
        the repository clone updated regardless of what Modules says - again this is
        just how Mercurial works, at least unless and until
        http://mercurial.selenic.com/wiki/PartialClone is implemented.

        Show
        jglick Jesse Glick added a comment - "the mercurial plugin does an hg clone for each job" - it should clone the first time, use update thereafter. Polling pays attention to the "Modules" field. If all changesets mention only files not present in this list, no build is triggered. If and when a build is run (because of polling or for any other reason), all changesets are pulled and the repository clone updated regardless of what Modules says - again this is just how Mercurial works, at least unless and until http://mercurial.selenic.com/wiki/PartialClone is implemented.
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in hudson
        User: : jglick
        Path:
        trunk/hudson/plugins/mercurial/src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java
        http://fisheye4.cenqua.com/changelog/hudson/?cs=21784
        Log:
        JENKINS-1099 Verifying that the Modules field controls how polling works.

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : jglick Path: trunk/hudson/plugins/mercurial/src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java http://fisheye4.cenqua.com/changelog/hudson/?cs=21784 Log: JENKINS-1099 Verifying that the Modules field controls how polling works.
        Hide
        aldobrucale aldobrucale added a comment -

        The modules list is read from the field _modules in
        hudson.plugins.mercurial.MercurialSCM, which is initialized in the constructor
        based on the modules field.

        However, when Hudson is restarted, the instances of MercurialSCM are
        deserialized, so the constructor is never called. Since the _modules field is
        transient, after deserialization it is always null and all changes are seen as
        dependent by MercurialSCM.dependentChanges().

        Show
        aldobrucale aldobrucale added a comment - The modules list is read from the field _modules in hudson.plugins.mercurial.MercurialSCM, which is initialized in the constructor based on the modules field. However, when Hudson is restarted, the instances of MercurialSCM are deserialized, so the constructor is never called. Since the _modules field is transient, after deserialization it is always null and all changes are seen as dependent by MercurialSCM.dependentChanges().
        Hide
        jglick Jesse Glick added a comment -

        .

        Show
        jglick Jesse Glick added a comment - .
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in hudson
        User: : jglick
        Path:
        trunk/hudson/plugins/mercurial/src/main/java/hudson/plugins/mercurial/MercurialSCM.java
        http://fisheye4.cenqua.com/changelog/hudson/?cs=23765
        Log:
        [FIXED JENKINS-1099] Properly persist modules list.

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : jglick Path: trunk/hudson/plugins/mercurial/src/main/java/hudson/plugins/mercurial/MercurialSCM.java http://fisheye4.cenqua.com/changelog/hudson/?cs=23765 Log: [FIXED JENKINS-1099] Properly persist modules list.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: