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

Bugs with branches

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: mercurial-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: Linux
    • Similar Issues:

      Description

      Two bugs when working with branches:

      1. Hudson thinks there are changes, even when there aren't any.

      2. Workspaces are not the proper checkout.

      Here are two patches for src/main/java/hudson/plugins/mercurial/MercurialSCM.java:

      For issue #1:

      // Get the list of changed files.
      + ArgumentListBuilder args = new ArgumentListBuilder();
      + args.add(getDescriptor().getHgExe(), "incoming", "--style",
      tmpFile.getCanonicalPath());
      + if (branch != null)

      { + args.add("-r", branch); + }

      +
      launcher.launch(

      • new String[] {getDescriptor().getHgExe(), "incoming", "--style", tmpFile.getCanonicalPath()}

        ,
        + args.toCommandArray(),
        EnvVars.masterEnvVars, new ForkOutputStream(baos, output),
        workspace).join();

      For issue #2:

      • if(branch!=null) args.add("-r",branch);
      • args.add(source,workspace.getRemote());
        + if(branch!=null) { + args.add(source + "#" + branch,workspace.getRemote()); + }

        else

        { + args.add(source,workspace.getRemote()); + }

        Attachments

          Issue Links

            Activity

            sfermigier sfermigier created issue -
            Hide
            sfermigier sfermigier added a comment -

            Created an attachment (id=316)
            "real" patch (unfortunately includes some auto-cleanup that my Eclipse did)

            Show
            sfermigier sfermigier added a comment - Created an attachment (id=316) "real" patch (unfortunately includes some auto-cleanup that my Eclipse did)
            Hide
            wiredduns wiredduns added a comment -

            to prevent "default" branch to see changes in other branches one needs to change:

            + if (branch != null)

            { + args.add("-r", branch); + }

            into

            + if (branch != null) {+ args.add("-r", branch);+ }

            else

            { + args.add("-r", "default"); + }
            Show
            wiredduns wiredduns added a comment - to prevent "default" branch to see changes in other branches one needs to change: + if (branch != null) { + args.add("-r", branch); + } into + if (branch != null) {+ args.add("-r", branch);+ } else { + args.add("-r", "default"); + }
            Hide
            bdelbosc bdelbosc added a comment -

            Created an attachment (id=406)
            This is a possible patch for https://svn.dev.java.net/svn/hudson/trunk/hudson/plugins/mercurial revison 12555

            Show
            bdelbosc bdelbosc added a comment - Created an attachment (id=406) This is a possible patch for https://svn.dev.java.net/svn/hudson/trunk/hudson/plugins/mercurial revison 12555
            Hide
            bdelbosc bdelbosc added a comment -

            The above patch seems to work fixing also #1355, #2047.

            It uses a "hg Up -C" to make sure to switch to the right branch. While "hg pull
            -u" update only when there is something to pull which is not always the case if
            you edit the job to change the branch name.

            The previous patch (Jul 10) don't work properly with changes and notification.

            Btw wiredduns you should not assume that there is always a branch named "default".

            Show
            bdelbosc bdelbosc added a comment - The above patch seems to work fixing also #1355, #2047. It uses a "hg Up -C" to make sure to switch to the right branch. While "hg pull -u" update only when there is something to pull which is not always the case if you edit the job to change the branch name. The previous patch (Jul 10) don't work properly with changes and notification. Btw wiredduns you should not assume that there is always a branch named "default".
            Hide
            jglick Jesse Glick added a comment -

            Sounds the same as issue #4281.

                • This issue has been marked as a duplicate of 4281 ***
            Show
            jglick Jesse Glick added a comment - Sounds the same as issue #4281. This issue has been marked as a duplicate of 4281 ***
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            jglick Jesse Glick made changes -
            Link This issue duplicates JENKINS-4281 [ JENKINS-4281 ]
            abayer Andrew Bayer made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 132130 ] JNJira + In-Review [ 201182 ]

              People

              • Assignee:
                kohsuke Kohsuke Kawaguchi
                Reporter:
                sfermigier sfermigier
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: