rename: emit hint about using --after consistently
Both the code and the message for the case where the source file was
missing was inconsistent with the other similar messages.
Differential Revision: https://phab.mercurial-scm.org/D4418
--- a/mercurial/cmdutil.py Wed Aug 29 09:50:39 2018 -0700
+++ b/mercurial/cmdutil.py Wed Aug 29 09:54:50 2018 -0700
@@ -1254,6 +1254,10 @@
else:
ui.warn(_('%s: cannot copy - %s\n') %
(relsrc, encoding.strtolocal(inst.strerror)))
+ if rename:
+ hint = _("('hg rename --after' to record the rename)\n")
+ else:
+ hint = _("('hg copy --after' to record the copy)\n")
return True # report a failure
if ui.verbose or not exact:
@@ -1371,9 +1375,6 @@
if copyfile(abssrc, relsrc, targetpath(abssrc), exact):
errors += 1
- if errors:
- ui.warn(_('(consider using --after)\n'))
-
return errors != 0
## facility to let extension process additional data into an import patch