[PATCH STABLE] graft: fix printing of --continue command
Adam Simpkins
simpkins at fb.com
Thu Apr 28 20:09:57 UTC 2016
# 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
More information about the Mercurial-devel
mailing list