Patchwork [08,of,22] vfs: use 'vfs' module directly in 'mercurial.simplemerge'

login
register
mail settings
Submitter Pierre-Yves David
Date March 8, 2017, 9:18 p.m.
Message ID <f9b148da25f6a92866ac.1489007899@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/19006/
State Accepted
Headers show

Comments

Pierre-Yves David - March 8, 2017, 9:18 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1488457858 -3600
#      Thu Mar 02 13:30:58 2017 +0100
# Node ID f9b148da25f6a92866ac52ec185a9cf0f622ae06
# Parent  2c27b19bbea4f4e86dd9a8b2130fb2a50d043fc6
# 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 f9b148da25f6
vfs: use 'vfs' module directly in 'mercurial.simplemerge'

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.

Patch

diff --git a/mercurial/simplemerge.py b/mercurial/simplemerge.py
--- a/mercurial/simplemerge.py
+++ b/mercurial/simplemerge.py
@@ -24,8 +24,8 @@  from .i18n import _
 from . import (
     error,
     mdiff,
-    scmutil,
     util,
+    vfs as vfsmod,
 )
 
 class CantReprocessAndShowBase(Exception):
@@ -437,7 +437,7 @@  def simplemerge(ui, local, base, other, 
 
     local = os.path.realpath(local)
     if not opts.get('print'):
-        opener = scmutil.vfs(os.path.dirname(local))
+        opener = vfsmod.vfs(os.path.dirname(local))
         out = opener(os.path.basename(local), "w", atomictemp=True)
     else:
         out = ui.fout