D5873: subrepo: always show relative path to .orig backup

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Feb 6 18:57:38 EST 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Same as previous commit, but for subrepo.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/subrepo.py
  tests/test-subrepo-git.t

CHANGE DETAILS

diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
--- a/tests/test-subrepo-git.t
+++ b/tests/test-subrepo-git.t
@@ -925,7 +925,7 @@
   $ hg revert --all --verbose --config 'ui.origbackuppath=.hg/origbackups'
   reverting subrepo ../gitroot
   creating directory: $TESTTMP/tc/.hg/origbackups
-  saving current version of foobar as $TESTTMP/tc/.hg/origbackups/foobar
+  saving current version of foobar as .hg/origbackups/foobar
   $ ls .hg/origbackups
   foobar
   $ rm -rf .hg/origbackups
diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1830,7 +1830,7 @@
             for name in names:
                 bakname = scmutil.origpath(self.ui, self._subparent, name)
                 self.ui.note(_('saving current version of %s as %s\n') %
-                        (name, bakname))
+                        (name, os.path.relpath(bakname)))
                 name = self.wvfs.join(name)
                 origvfs.rename(name, bakname)
 



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


More information about the Mercurial-devel mailing list