[PATCH 02 of 22] vfs: use 'vfs' module directly in 'mercurial.repair'

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Mar 8 16:18:13 EST 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1488457783 -3600
#      Thu Mar 02 13:29:43 2017 +0100
# Node ID 3ea27e3eb238450add3bca5b9d23f9bba3ddfced
# Parent  c46a9910b10778bfa378ef4e37d66dfb270d23e6
# 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 3ea27e3eb238
vfs: use 'vfs' module directly in 'mercurial.repair'

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.

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -26,6 +26,7 @@ from . import (
     revlog,
     scmutil,
     util,
+    vfs as vfsmod,
 )
 
 def _bundle(repo, bases, heads, node, suffix, compress=True):
@@ -882,7 +883,7 @@ def _upgraderepo(ui, srcrepo, dstrepo, r
     ui.write(_('data fully migrated to temporary repository\n'))
 
     backuppath = tempfile.mkdtemp(prefix='upgradebackup.', dir=srcrepo.path)
-    backupvfs = scmutil.vfs(backuppath)
+    backupvfs = vfsmod.vfs(backuppath)
 
     # Make a backup of requires file first, as it is the first to be modified.
     util.copyfile(srcrepo.join('requires'), backupvfs.join('requires'))


More information about the Mercurial-devel mailing list