@@ -17,7 +17,7 @@ from mercurial import (
for fp in (sys.stdin, sys.stdout, sys.stderr):
util.setbinary(fp)
-opener = scmutil.opener('.', False)
+opener = scmutil.vfs('.', False)
tr = transaction.transaction(sys.stderr.write, opener, {'store': opener},
"undump.journal")
while True:
@@ -1146,8 +1146,8 @@ class svn_sink(converter_sink, commandli
self.run0('checkout', path, wcpath)
self.wc = wcpath
- self.opener = scmutil.opener(self.wc)
- self.wopener = scmutil.opener(self.wc)
+ self.opener = scmutil.vfs(self.wc)
+ self.wopener = scmutil.vfs(self.wc)
self.childmap = mapfile(ui, self.join('hg-childmap'))
if util.checkexec(self.wc):
self.is_exec = util.isexec
@@ -144,7 +144,7 @@ def openlfdirstate(ui, repo, create=True
'''
vfs = repo.vfs
lfstoredir = longname
- opener = scmutil.opener(vfs.join(lfstoredir))
+ opener = scmutil.vfs(vfs.join(lfstoredir))
lfdirstate = largefilesdirstate(opener, ui, repo.root,
repo.dirstate._validate)
@@ -434,7 +434,7 @@ class queue(object):
except IOError:
curpath = os.path.join(path, 'patches')
self.path = patchdir or curpath
- self.opener = scmutil.opener(self.path)
+ self.opener = scmutil.vfs(self.path)
self.ui = ui
self.baseui = baseui
self.applieddirty = False
@@ -60,7 +60,7 @@ class transplants(object):
self.opener = opener
if not opener:
- self.opener = scmutil.opener(self.path)
+ self.opener = scmutil.vfs(self.path)
self.transplants = {}
self.dirty = False
self.read()
@@ -103,7 +103,7 @@ class transplanter(object):
def __init__(self, ui, repo, opts):
self.ui = ui
self.path = repo.join('transplant')
- self.opener = scmutil.opener(self.path)
+ self.opener = scmutil.vfs(self.path)
self.transplants = transplants(self.path, 'transplants',
opener=self.opener)
def getcommiteditor():
@@ -249,7 +249,7 @@ class fileit(object):
def __init__(self, name, mtime):
self.basedir = name
- self.opener = scmutil.opener(self.basedir)
+ self.opener = scmutil.vfs(self.basedir)
def addfile(self, name, mode, islink, data):
if islink:
@@ -583,7 +583,7 @@ def openrevlog(repo, cmd, file_, opts):
raise error.CommandError(cmd, _('invalid arguments'))
if not os.path.isfile(file_):
raise error.Abort(_("revlog '%s' not found") % file_)
- r = revlog.revlog(scmutil.opener(pycompat.getcwd(), audit=False),
+ r = revlog.revlog(scmutil.vfs(pycompat.getcwd(), audit=False),
file_[:-2] + ".i")
return r
@@ -76,7 +76,7 @@ def debugancestor(ui, repo, *args):
"""find the ancestor revision of two revisions in a given index"""
if len(args) == 3:
index, rev1, rev2 = args
- r = revlog.revlog(scmutil.opener(pycompat.getcwd(), audit=False), index)
+ r = revlog.revlog(scmutil.vfs(pycompat.getcwd(), audit=False), index)
lookup = r.lookup
elif len(args) == 2:
if not repo:
@@ -452,7 +452,7 @@ def debugdag(ui, repo, file_=None, *revs
spaces = opts.get('spaces')
dots = opts.get('dots')
if file_:
- rlog = revlog.revlog(scmutil.opener(pycompat.getcwd(), audit=False),
+ rlog = revlog.revlog(scmutil.vfs(pycompat.getcwd(), audit=False),
file_)
revs = set((int(r) for r in revs))
def events():
@@ -449,7 +449,7 @@ class abstractbackend(object):
class fsbackend(abstractbackend):
def __init__(self, ui, basedir):
super(fsbackend, self).__init__(ui)
- self.opener = scmutil.opener(basedir)
+ self.opener = scmutil.vfs(basedir)
def _join(self, f):
return os.path.join(self.opener.base, f)
@@ -560,7 +560,7 @@ class filestore(object):
else:
if self.opener is None:
root = tempfile.mkdtemp(prefix='hg-patch-')
- self.opener = scmutil.opener(root)
+ self.opener = scmutil.vfs(root)
# Avoid filename issues with these simple names
fn = str(self.created)
self.opener.write(fn, data)
@@ -437,7 +437,7 @@ def simplemerge(ui, local, base, other,
local = os.path.realpath(local)
if not opts.get('print'):
- opener = scmutil.opener(os.path.dirname(local))
+ opener = scmutil.vfs(os.path.dirname(local))
out = opener(os.path.basename(local), "w", atomictemp=True)
else:
out = ui.fout
@@ -73,7 +73,7 @@ def basic(repo):
# atomic replace file, size doesn't change
# hopefully st_mtime doesn't change as well so this doesn't use the cache
# because of inode change
- f = scmutil.opener('.')('x', 'w', atomictemp=True)
+ f = scmutil.vfs('.')('x', 'w', atomictemp=True)
f.write('b')
f.close()
@@ -97,7 +97,7 @@ def basic(repo):
# should recreate the object
repo.cached
- f = scmutil.opener('.')('y', 'w', atomictemp=True)
+ f = scmutil.vfs('.')('y', 'w', atomictemp=True)
f.write('B')
f.close()
@@ -105,10 +105,10 @@ def basic(repo):
print("* file y changed inode")
repo.cached
- f = scmutil.opener('.')('x', 'w', atomictemp=True)
+ f = scmutil.vfs('.')('x', 'w', atomictemp=True)
f.write('c')
f.close()
- f = scmutil.opener('.')('y', 'w', atomictemp=True)
+ f = scmutil.vfs('.')('y', 'w', atomictemp=True)
f.write('C')
f.close()
@@ -42,7 +42,7 @@ We approximate that by reducing the read
> return getattr(self.real, key)
>
> def opener(*args):
- > o = scmutil.opener(*args)
+ > o = scmutil.vfs(*args)
> def wrapper(*a):
> f = o(*a)
> return singlebyteread(f)