comparison mercurial/subrepo.py @ 40753:9199548525fc

subrepo-git: use an official origvfs when appropriate The origvfs has the auditor properly set and can move file without issue. The current code is currently working without errors because rename are not audited, yet.
author Boris Feld <boris.feld@octobus.net>
date Thu, 22 Nov 2018 20:01:28 +0100
parents 69d4c8c5c25e
children 6c10eba6b9cd 46ab0c6b28dc
comparison
equal deleted inserted replaced
40752:65591a513b9c 40753:9199548525fc
1808 def revert(self, substate, *pats, **opts): 1808 def revert(self, substate, *pats, **opts):
1809 self.ui.status(_('reverting subrepo %s\n') % substate[0]) 1809 self.ui.status(_('reverting subrepo %s\n') % substate[0])
1810 if not opts.get(r'no_backup'): 1810 if not opts.get(r'no_backup'):
1811 status = self.status(None) 1811 status = self.status(None)
1812 names = status.modified 1812 names = status.modified
1813 origvfs = scmutil.getorigvfs(self.ui, self._subparent)
1814 if origvfs is None:
1815 origvfs = self.wvfs
1813 for name in names: 1816 for name in names:
1814 bakname = scmutil.origpath(self.ui, self._subparent, name) 1817 bakname = scmutil.origpath(self.ui, self._subparent, name)
1815 self.ui.note(_('saving current version of %s as %s\n') % 1818 self.ui.note(_('saving current version of %s as %s\n') %
1816 (name, bakname)) 1819 (name, bakname))
1817 self.wvfs.rename(name, bakname) 1820 name = self.wvfs.join(name)
1821 origvfs.rename(name, bakname)
1818 1822
1819 if not opts.get(r'dry_run'): 1823 if not opts.get(r'dry_run'):
1820 self.get(substate, overwrite=True) 1824 self.get(substate, overwrite=True)
1821 return [] 1825 return []
1822 1826