Patchwork [3,of,5] localrepo: use 'wvfs' instead of 'wfile'

login
register
mail settings
Submitter Pierre-Yves David
Date March 15, 2017, 7:43 a.m.
Message ID <80da55359b3458499181.1489563812@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/19356/
State Accepted
Headers show

Comments

Pierre-Yves David - March 15, 2017, 7:43 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1489562949 25200
#      Wed Mar 15 00:29:09 2017 -0700
# Node ID 80da55359b34584991814524f6a11eaa1a97b55f
# Parent  facaf8ca3cea37059909cf61140bed0f6ae379e6
# 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 80da55359b34
localrepo: use 'wvfs' instead of 'wfile'

Method is about to be deprecated and the modern form is shorter.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -689,11 +689,11 @@  class localrepository(object):
             return
 
         try:
-            fp = self.wfile('.hgtags', 'rb+')
+            fp = self.wvfs('.hgtags', 'rb+')
         except IOError as e:
             if e.errno != errno.ENOENT:
                 raise
-            fp = self.wfile('.hgtags', 'ab')
+            fp = self.wvfs('.hgtags', 'ab')
         else:
             prevtags = fp.read()