D5859: subrepo: migrate to scmutil.backuppath()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Feb 5 17:53:27 UTC 2019


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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/subrepo.py

CHANGE DETAILS

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1828,11 +1828,10 @@
             if origvfs is None:
                 origvfs = self.wvfs
             for name in names:
-                bakname = scmutil.origpath(self.ui, self._subparent, name)
+                bakname = scmutil.backuppath(self.ui, self._subparent, name)
                 self.ui.note(_('saving current version of %s as %s\n') %
                         (name, bakname))
-                name = self.wvfs.join(name)
-                origvfs.rename(name, bakname)
+                origvfs.rename(self.wvfs.join(name), self.wvfs.join(bakname))
 
         if not opts.get(r'dry_run'):
             self.get(substate, overwrite=True)



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


More information about the Mercurial-devel mailing list