diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -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