mercurial/subrepo.py
changeset 40753 9199548525fc
parent 40655 69d4c8c5c25e
child 41457 6c10eba6b9cd
child 41483 46ab0c6b28dc
--- a/mercurial/subrepo.py	Thu Nov 22 19:26:05 2018 +0100
+++ b/mercurial/subrepo.py	Thu Nov 22 20:01:28 2018 +0100
@@ -1810,11 +1810,15 @@
         if not opts.get(r'no_backup'):
             status = self.status(None)
             names = status.modified
+            origvfs = scmutil.getorigvfs(self.ui, self._subparent)
+            if origvfs is None:
+                origvfs = self.wvfs
             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))
-                self.wvfs.rename(name, bakname)
+                name = self.wvfs.join(name)
+                origvfs.rename(name, bakname)
 
         if not opts.get(r'dry_run'):
             self.get(substate, overwrite=True)