Mercurial branches with spaces not correctly escaped getting changelog

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor
    • Component/s: mercurial-plugin
    • None
    • Environment:
      Jenkins 1.649, Windows 10 x64

      When cloning a repository with a branch name that contains spaces the polling fails with:

      hg parsing error at 4: invalid token

      after the "hg log" command getting changelog.

      The problem seems related on how hg parses the command line and escaping of the console and hg.
      For example:

      hg log --rev "branch with spaces"

      will work, but:

      hg log --rev "branch with spaces" --follow
      or:
      hg log --follow --rev "branch with spaces"

      will not (with the same error reported). A typical "hg log" command generated with mercurial-plugin is like this command (with many other parameters).

      The correct command should be something like:

      hg log --rev '"branch with spaces"' --follow ...etc...

      using single quotes for the console and double quotes for the hg/python parser.

            Assignee:
            Jesse Glick
            Reporter:
            Stefano Moser
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: