# HG changeset patch # User Boris Feld # Date 2018-11-22 19:01:28 # Node ID 9199548525fc6fd3ac97969f94c570776a5cd001 # Parent 65591a513b9c10b6145ce2418068682ad51bb5ef 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. diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -1810,11 +1810,15 @@ class gitsubrepo(abstractsubrepo): 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)