# HG changeset patch # User Martin von Zweigbergk # Date 2018-08-29 16:54:50 # Node ID 534e451b6ddaf814c72db2dd375ed130f164982f # Parent cde75233c41584a0b1b4543c2891336869e293eb 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 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1254,6 +1254,10 @@ def copy(ui, repo, pats, opts, rename=Fa 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 @@ def copy(ui, repo, pats, opts, rename=Fa 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