changeset 39349:534e451b6dda

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
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 29 Aug 2018 09:54:50 -0700
parents cde75233c415
children 5b92a717bfc1
files mercurial/cmdutil.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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