localrepo: remove all external users of localrepo.wopener
This change touches every module in which repository.wopener was being used, and
changes it for the equivalent repository.wvfs.
It should now be possible to remove localrepo.wopener.
--- a/hgext/keyword.py Sun Jan 11 00:25:54 2015 +0100
+++ b/hgext/keyword.py Sun Jan 11 01:51:52 2015 +0100
@@ -282,7 +282,7 @@
data, found = _shrinktext(data, re_kw.subn)
if found:
self.ui.note(msg % f)
- fp = self.repo.wopener(f, "wb", atomictemp=True)
+ fp = self.repo.wvfs(f, "wb", atomictemp=True)
fp.write(data)
fp.close()
if kwcmd:
@@ -440,7 +440,7 @@
demoitems('keywordset', ui.configitems('keywordset'))
demoitems('keywordmaps', kwmaps.iteritems())
keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n'
- repo.wopener.write(fn, keywords)
+ repo.wvfs.write(fn, keywords)
repo[None].add([fn])
ui.note(_('\nkeywords written to %s:\n') % fn)
ui.note(keywords)
--- a/hgext/mq.py Sun Jan 11 00:25:54 2015 +0100
+++ b/hgext/mq.py Sun Jan 11 01:51:52 2015 +0100
@@ -2306,7 +2306,7 @@
q.savedirty()
if r:
if not os.path.exists(r.wjoin('.hgignore')):
- fp = r.wopener('.hgignore', 'w')
+ fp = r.wvfs('.hgignore', 'w')
fp.write('^\\.hg\n')
fp.write('^\\.mq\n')
fp.write('syntax: glob\n')
@@ -2314,7 +2314,7 @@
fp.write('guards\n')
fp.close()
if not os.path.exists(r.wjoin('series')):
- r.wopener('series', 'w').close()
+ r.wvfs('series', 'w').close()
r[None].add(['.hgignore', 'series'])
commands.add(ui, r)
return 0
--- a/mercurial/merge.py Sun Jan 11 00:25:54 2015 +0100
+++ b/mercurial/merge.py Sun Jan 11 01:51:52 2015 +0100
@@ -301,7 +301,7 @@
if f2 is None:
f2 = f
return (os.path.isfile(repo.wjoin(f))
- and repo.wopener.audit.check(f)
+ and repo.wvfs.audit.check(f)
and repo.dirstate.normalize(f) not in repo.dirstate
and mctx[f2].cmp(wctx[f]))
@@ -651,7 +651,7 @@
verbose = repo.ui.verbose
unlink = util.unlinkpath
wjoin = repo.wjoin
- audit = repo.wopener.audit
+ audit = repo.wvfs.audit
i = 0
for f, args, msg in actions:
repo.ui.debug(" %s: %s -> r\n" % (f, msg))
@@ -727,7 +727,7 @@
if f1 != f and move:
moves.append(f1)
- audit = repo.wopener.audit
+ audit = repo.wvfs.audit
_updating = _('updating')
_files = _('files')
progress = repo.ui.progress