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

Better handling of Mercurial branches

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • mercurial-plugin
    • None
    • Platform: All, OS: All

      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);

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

              Created:
              Updated:
              Resolved: