changeset 41605:e67a85e0f19e

mq: always show relative path to .orig backup Same as previous commit, but for mq (I would have folded them, but test-check-commit doesn't like "revert/mq" as a topic and I couldn't think of a better one). Differential Revision: https://phab.mercurial-scm.org/D5872
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 06 Feb 2019 15:26:53 -0800
parents 4d4842445afc
children 59025c9b3540
files hgext/mq.py tests/test-mq.t
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Wed Feb 06 14:57:08 2019 -0800
+++ b/hgext/mq.py	Wed Feb 06 15:26:53 2019 -0800
@@ -738,10 +738,10 @@
         for f in sorted(files):
             absf = repo.wjoin(f)
             if os.path.lexists(absf):
+                absorig = scmutil.origpath(self.ui, repo, absf)
                 self.ui.note(_('saving current version of %s as %s\n') %
-                             (f, scmutil.origpath(self.ui, repo, f)))
-
-                absorig = scmutil.origpath(self.ui, repo, absf)
+                             (f, os.path.relpath(absorig)))
+
                 if copy:
                     util.copyfile(absf, absorig)
                 else:
--- a/tests/test-mq.t	Wed Feb 06 14:57:08 2019 -0800
+++ b/tests/test-mq.t	Wed Feb 06 15:26:53 2019 -0800
@@ -1406,7 +1406,7 @@
   $ hg qpush -f --verbose --config 'ui.origbackuppath=.hg/origbackups'
   applying empty
   creating directory: $TESTTMP/forcepush/.hg/origbackups
-  saving current version of hello.txt as $TESTTMP/forcepush/.hg/origbackups/hello.txt
+  saving current version of hello.txt as .hg/origbackups/hello.txt
   patching file hello.txt
   committing files:
   hello.txt