Patchwork D5872: mq: always show relative path to .orig backup

login
register
mail settings
Submitter phabricator
Date Feb. 7, 2019, 2:03 a.m.
Message ID <427da4e024a30bd679b8aa449c9d5611@localhost.localdomain>
Download mbox | patch
Permalink /patch/38502/
State Not Applicable
Headers show

Comments

phabricator - Feb. 7, 2019, 2:03 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe67a85e0f19e: mq: always show relative path to .orig backup (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5872?vs=13853&id=13870

REVISION DETAIL
  https://phab.mercurial-scm.org/D5872

AFFECTED FILES
  hgext/mq.py
  tests/test-mq.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-mq.t b/tests/test-mq.t
--- a/tests/test-mq.t
+++ b/tests/test-mq.t
@@ -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
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -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: