rename: emit hint about using --after consistently
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 29 Aug 2018 09:54:50 -0700
changeset 39349 534e451b6dda
parent 39348 cde75233c415
child 39350 5b92a717bfc1
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
mercurial/cmdutil.py
--- 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