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

Better handling of Mercurial branches

    Details

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

      Description

      I have some suggestions to improve the current sequence of hg commands issued by
      the Mercurial plugin.

      Currently we have:

      hg incoming --quiet --bundle hg.bundle --template [blah...] -r $branch
      hg pull -u hg.bundle ## ( this command doesn't specify which branch the working
      copy should be brought to )

      I think this would be better:

      hg incoming --quiet --bundle hg.bundle --template [blah...] -r $branch
      hg pull hg.bundle ## ( instead of 'hg pull -u hg.bundle' )
      hg update -C -r $revision ### ( this command should bring the working copy to
      the tip of the specified branch )

      On the Java side, instead of

      if (branch!=null) args.add("-r",branch);
      else args.add("-r", "default");

      I suggest this:

      if (null == branch || branch.trim().length() == 0)

      { // Excplicitly select the default branch branch = "default"; }

      // It's safer to ALWAYS specify which branch to use
      args.add("-r", branch);

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: