Patchwork [3,of,3] vfs: use 'vfs' module directly in 'mercurial.hg'

login
register
mail settings
Submitter Pierre-Yves David
Date March 8, 2017, 7:01 a.m.
Message ID <b033990d12c81527cb1b.1488956509@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/18991/
State Accepted
Headers show

Comments

Pierre-Yves David - March 8, 2017, 7:01 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1488457662 -3600
#      Thu Mar 02 13:27:42 2017 +0100
# Node ID b033990d12c81527cb1be32b6941086e5f419ad1
# Parent  69ef1663d5fe2a3bf7bd4138b98ae373b1848591
# EXP-Topic vfs.cleanup
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r b033990d12c8
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.
Augie Fackler - March 8, 2017, 3:47 p.m.
On Wed, Mar 08, 2017 at 08:01:49AM +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1488457662 -3600
> #      Thu Mar 02 13:27:42 2017 +0100
> # Node ID b033990d12c81527cb1be32b6941086e5f419ad1
> # Parent  69ef1663d5fe2a3bf7bd4138b98ae373b1848591
> # EXP-Topic vfs.cleanup
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r b033990d12c8
> vfs: use 'vfs' module directly in 'mercurial.hg'

Queued, thanks.

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -40,6 +40,7 @@  from . import (
     url,
     util,
     verify as verifymod,
+    vfs as vfsmod,
 )
 
 release = lock.release
@@ -219,8 +220,8 @@  def share(ui, source, dest=None, update=
 
     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 @@  def copystore(ui, srcrepo, destpath):
             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 @@  def clonewithshare(ui, peeropts, sharepa
         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 @@  def clone(ui, peeropts, source, dest=Non
     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)