comparison mercurial/subrepo.py @ 24695:419528cb05b6

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.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 07 Feb 2015 12:57:40 -0500
parents f282db2834f9
children 95eb067b2b5e
comparison
equal deleted inserted replaced
24694:f282db2834f9 24695:419528cb05b6
1288 (command, p.returncode, self._relpath)) 1288 (command, p.returncode, self._relpath))
1289 1289
1290 return retdata, p.returncode 1290 return retdata, p.returncode
1291 1291
1292 def _gitmissing(self): 1292 def _gitmissing(self):
1293 return not os.path.exists(os.path.join(self._abspath, '.git')) 1293 return not self.wvfs.exists('.git')
1294 1294
1295 def _gitstate(self): 1295 def _gitstate(self):
1296 return self._gitcommand(['rev-parse', 'HEAD']) 1296 return self._gitcommand(['rev-parse', 'HEAD'])
1297 1297
1298 def _gitcurrentbranch(self): 1298 def _gitcurrentbranch(self):
1802 names = status.modified 1802 names = status.modified
1803 for name in names: 1803 for name in names:
1804 bakname = "%s.orig" % name 1804 bakname = "%s.orig" % name
1805 self.ui.note(_('saving current version of %s as %s\n') % 1805 self.ui.note(_('saving current version of %s as %s\n') %
1806 (name, bakname)) 1806 (name, bakname))
1807 util.rename(os.path.join(self._abspath, name), 1807 self.wvfs.rename(name, bakname)
1808 os.path.join(self._abspath, bakname))
1809 1808
1810 if not opts.get('dry_run'): 1809 if not opts.get('dry_run'):
1811 self.get(substate, overwrite=True) 1810 self.get(substate, overwrite=True)
1812 return [] 1811 return []
1813 1812