[PATCH STABLE] graft: fix printing of --continue command

timeless timeless at gmail.com
Thu Apr 28 20:22:46 EDT 2016


looks good to me, thanks.

On Thu, Apr 28, 2016 at 4:09 PM, Adam Simpkins <simpkins at fb.com> wrote:
> # HG changeset patch
> # User Adam Simpkins <simpkins at fb.com>
> # Date 1461810271 25200
> #      Wed Apr 27 19:24:31 2016 -0700
> # Branch stable
> # Node ID 6fc8c1e263cf95cc5cd023c83187c134dc79d81a
> # Parent  87d4a6c5567e81386b8c2209d95060d5bf72e064
> graft: fix printing of --continue command
>
> Properly shell quote arguments, to avoid printing commands that won't work when
> run literally.  For example, a date string with timestamp needs to be quoted:
> --date '1456953053 28800'
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -4231,9 +4231,9 @@
>                  repo.vfs.write('graftstate', ''.join(nodelines))
>                  extra = ''
>                  if opts.get('user'):
> -                    extra += ' --user %s' % opts['user']
> +                    extra += ' --user %s' % util.shellquote(opts['user'])
>                  if opts.get('date'):
> -                    extra += ' --date %s' % opts['date']
> +                    extra += ' --date %s' % util.shellquote(opts['date'])
>                  if opts.get('log'):
>                      extra += ' --log'
>                  hint=_("use 'hg resolve' and 'hg graft --continue%s'") % extra
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list