##// END OF EJS Templates
subrepo: migrate to scmutil.backuppath()...
Martin von Zweigbergk -
r41743:8f09edf6 default draft
parent child Browse files
Show More
@@ -1824,15 +1824,15 b' class gitsubrepo(abstractsubrepo):'
1824 if not opts.get(r'no_backup'):
1824 if not opts.get(r'no_backup'):
1825 status = self.status(None)
1825 status = self.status(None)
1826 names = status.modified
1826 names = status.modified
1827 origvfs = scmutil.getorigvfs(self.ui, self._subparent)
1828 if origvfs is None:
1829 origvfs = self.wvfs
1830 for name in names:
1827 for name in names:
1831 bakname = scmutil.origpath(self.ui, self._subparent, name)
1828 # backuppath() expects a path relative to the parent repo (the
1829 # repo that ui.origbackuppath is relative to)
1830 parentname = os.path.join(self._path, name)
1831 bakname = scmutil.backuppath(self.ui, self._subparent,
1832 parentname)
1832 self.ui.note(_('saving current version of %s as %s\n') %
1833 self.ui.note(_('saving current version of %s as %s\n') %
1833 (name, os.path.relpath(bakname)))
1834 (name, os.path.relpath(bakname)))
1834 name = self.wvfs.join(name)
1835 util.rename(self.wvfs.join(name), bakname)
1835 origvfs.rename(name, bakname)
1836
1836
1837 if not opts.get(r'dry_run'):
1837 if not opts.get(r'dry_run'):
1838 self.get(substate, overwrite=True)
1838 self.get(substate, overwrite=True)
@@ -924,9 +924,9 b' revert moves orig files to the right pla'
924 $ echo 'bloop' > s/foobar
924 $ echo 'bloop' > s/foobar
925 $ hg revert --all --verbose --config 'ui.origbackuppath=.hg/origbackups'
925 $ hg revert --all --verbose --config 'ui.origbackuppath=.hg/origbackups'
926 reverting subrepo ../gitroot
926 reverting subrepo ../gitroot
927 creating directory: $TESTTMP/tc/.hg/origbackups
927 creating directory: $TESTTMP/tc/.hg/origbackups/s
928 saving current version of foobar as .hg/origbackups/foobar
928 saving current version of foobar as .hg/origbackups/s/foobar
929 $ ls .hg/origbackups
929 $ ls .hg/origbackups/s
930 foobar
930 foobar
931 $ rm -rf .hg/origbackups
931 $ rm -rf .hg/origbackups
932
932
General Comments 0
You need to be logged in to leave comments. Login now