rename: quote hg commands in warnings
I think we usally use single quotes around hg commands in messages.
Differential Revision: https://phab.mercurial-scm.org/D4417
--- a/mercurial/cmdutil.py Tue Aug 21 21:05:01 2018 +0800
+++ b/mercurial/cmdutil.py Wed Aug 29 09:50:39 2018 -0700
@@ -1207,17 +1207,17 @@
else:
flags = '--force'
if rename:
- hint = _('(hg rename %s to replace the file by '
+ hint = _("('hg rename %s' to replace the file by "
'recording a rename)\n') % flags
else:
- hint = _('(hg copy %s to replace the file by '
+ hint = _("('hg copy %s' to replace the file by "
'recording a copy)\n') % flags
else:
msg = _('%s: not overwriting - file exists\n')
if rename:
- hint = _('(hg rename --after to record the rename)\n')
+ hint = _("('hg rename --after' to record the rename)\n")
else:
- hint = _('(hg copy --after to record the copy)\n')
+ hint = _("('hg copy --after' to record the copy)\n")
ui.warn(msg % reltarget)
ui.warn(hint)
return
--- a/tests/test-copy.t Tue Aug 21 21:05:01 2018 +0800
+++ b/tests/test-copy.t Wed Aug 29 09:50:39 2018 -0700
@@ -224,12 +224,12 @@
Trying to copy on top of an existing file fails,
$ hg copy -A bar foo
foo: not overwriting - file already committed
- (hg copy --after --force to replace the file by recording a copy)
+ ('hg copy --after --force' to replace the file by recording a copy)
same error without the --after, so the user doesn't have to go through
two hints:
$ hg copy bar foo
foo: not overwriting - file already committed
- (hg copy --force to replace the file by recording a copy)
+ ('hg copy --force' to replace the file by recording a copy)
but it's considered modified after a copy --after --force
$ hg copy -Af bar foo
$ hg st -AC foo
@@ -240,6 +240,6 @@
$ touch xyzzy
$ hg cp bar xyzzy
xyzzy: not overwriting - file exists
- (hg copy --after to record the copy)
+ ('hg copy --after' to record the copy)
$ cd ..
--- a/tests/test-rename.t Tue Aug 21 21:05:01 2018 +0800
+++ b/tests/test-rename.t Wed Aug 29 09:50:39 2018 -0700
@@ -266,7 +266,7 @@
$ hg rename d1/* d2
d2/b: not overwriting - file already committed
- (hg rename --force to replace the file by recording a rename)
+ ('hg rename --force' to replace the file by recording a rename)
moving d1/d11/a1 to d2/d11/a1
$ hg status -C
A d2/a
@@ -371,7 +371,7 @@
$ echo "ca" > d1/ca
$ hg rename d1/ba d1/ca
d1/ca: not overwriting - file exists
- (hg rename --after to record the rename)
+ ('hg rename --after' to record the rename)
$ hg status -C
? d1/ca
$ hg update -C
@@ -395,7 +395,7 @@
$ ln -s ba d1/ca
$ hg rename --traceback d1/ba d1/ca
d1/ca: not overwriting - file exists
- (hg rename --after to record the rename)
+ ('hg rename --after' to record the rename)
$ hg status -C
? d1/ca
$ hg update -C