firefoxtree: use repo.vfs (
bug 1359956); r?glob
Mercurial 4.2 deprecated repo.opener in favor of repo.vfs. Use it.
MozReview-Commit-ID: Bi6ymMSO93L
--- a/hgext/firefoxtree/__init__.py
+++ b/hgext/firefoxtree/__init__.py
@@ -141,17 +141,17 @@ def isfirefoxrepo(repo):
try:
if len(repo) and repo[0].hex() in (MOZ_ROOT_REV, COMM_ROOT_REV):
return True
except error.FilteredRepoLookupError:
pass
# Backdoor for testing.
- return repo.opener.exists('IS_FIREFOX_REPO')
+ return repo.vfs.exists('IS_FIREFOX_REPO')
# Wrap repo lookup to automagically resolve tree names to URIs.
def peerorrepo(orig, ui, path, *args, **kwargs):
try:
return orig(ui, path, *args, **kwargs)
except RepoError:
tree, uri = resolve_trees_to_uris([path])[0]
if not uri:
@@ -225,17 +225,17 @@ def writefirefoxtrees(repo):
with open(repo._firefoxtreespath, 'wb') as fh:
fh.write('\n'.join(lines))
# Old versions of firefoxtrees stored labels in the localtags file. Since
# this file is read by Mercurial and has no relevance to us any more, we
# prune relevant entries from this file so the data isn't redundant with
# what we now write.
- localtags = repo.opener.tryread('localtags')
+ localtags = repo.vfs.tryread('localtags')
havedata = len(localtags) > 0
taglines = []
for line in localtags.splitlines():
line = line.strip()
node, tag = line.split()
tree, uri = resolve_trees_to_uris([tag])[0]
if not uri:
taglines.append(line)