changeset 31218:4cc3797aa59c

vfs: use 'vfs' module directly in 'mercurial.hg' Now that the 'vfs' classes moved in their own module, lets use the new module directly. We update code iteratively to help with possible bisect needs in the future.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Thu, 02 Mar 2017 13:27:42 +0100
parents 0f31830fbfc4
children f8e06821c118
files mercurial/hg.py
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Wed Mar 01 11:00:12 2017 +0100
+++ b/mercurial/hg.py	Thu Mar 02 13:27:42 2017 +0100
@@ -40,6 +40,7 @@
     url,
     util,
     verify as verifymod,
+    vfs as vfsmod,
 )
 
 release = lock.release
@@ -219,8 +220,8 @@
 
     sharedpath = srcrepo.sharedpath # if our source is already sharing
 
-    destwvfs = scmutil.vfs(dest, realpath=True)
-    destvfs = scmutil.vfs(os.path.join(destwvfs.base, '.hg'), realpath=True)
+    destwvfs = vfsmod.vfs(dest, realpath=True)
+    destvfs = vfsmod.vfs(os.path.join(destwvfs.base, '.hg'), realpath=True)
 
     if destvfs.lexists():
         raise error.Abort(_('destination already exists'))
@@ -312,8 +313,8 @@
             else:
                 ui.progress(topic, pos + num)
         srcpublishing = srcrepo.publishing()
-        srcvfs = scmutil.vfs(srcrepo.sharedpath)
-        dstvfs = scmutil.vfs(destpath)
+        srcvfs = vfsmod.vfs(srcrepo.sharedpath)
+        dstvfs = vfsmod.vfs(destpath)
         for f in srcrepo.store.copylist():
             if srcpublishing and f.endswith('phaseroots'):
                 continue
@@ -369,7 +370,7 @@
         if e.errno != errno.EEXIST:
             raise
 
-    poolvfs = scmutil.vfs(pooldir)
+    poolvfs = vfsmod.vfs(pooldir)
     basename = os.path.basename(sharepath)
 
     with lock.lock(poolvfs, '%s.lock' % basename):
@@ -474,7 +475,7 @@
     if not dest:
         raise error.Abort(_("empty destination path is not valid"))
 
-    destvfs = scmutil.vfs(dest, expandpath=True)
+    destvfs = vfsmod.vfs(dest, expandpath=True)
     if destvfs.lexists():
         if not destvfs.isdir():
             raise error.Abort(_("destination '%s' already exists") % dest)