subrepo: convert the os.path references in git to vfs
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 07 Feb 2015 12:57:40 -0500
changeset 24695 419528cb05b6
parent 24694 f282db2834f9
child 24696 553dc2b094d9
subrepo: convert the os.path references in git to vfs There are a handful of os.path references in the free functions at the top of the module that will be trickier to remove.
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Sat Apr 11 00:47:09 2015 +0900
+++ b/mercurial/subrepo.py	Sat Feb 07 12:57:40 2015 -0500
@@ -1290,7 +1290,7 @@
         return retdata, p.returncode
 
     def _gitmissing(self):
-        return not os.path.exists(os.path.join(self._abspath, '.git'))
+        return not self.wvfs.exists('.git')
 
     def _gitstate(self):
         return self._gitcommand(['rev-parse', 'HEAD'])
@@ -1804,8 +1804,7 @@
                 bakname = "%s.orig" % name
                 self.ui.note(_('saving current version of %s as %s\n') %
                         (name, bakname))
-                util.rename(os.path.join(self._abspath, name),
-                            os.path.join(self._abspath, bakname))
+                self.wvfs.rename(name, bakname)
 
         if not opts.get('dry_run'):
             self.get(substate, overwrite=True)