Mercurial > public > mercurial-scm > hg-stable
diff mercurial/scmutil.py @ 17649:f65c6a5f256c
scmutil: rename classes from "opener" to "vfs"
For backwards compatibility, aliases for the old names are added,
except for "abstractopener", "statichttpopener" and "_fncacheopener",
because these are not used in Mercurial core implementation after this
patch.
"_fncacheopener" was only referred in "fncachestore" constructor, so
this patch also renames from "_fncacheopener" to "_fncachevfs" there.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 31 Aug 2012 02:06:29 +0900 |
parents | 4647aa33ad81 |
children | 8575f4a2126e |
line wrap: on
line diff
--- a/mercurial/scmutil.py Mon Aug 13 21:25:48 2012 +0900 +++ b/mercurial/scmutil.py Fri Aug 31 02:06:29 2012 +0900 @@ -167,7 +167,7 @@ # want to add "foo/bar/baz" before checking if there's a "foo/.hg" self.auditeddir.update(prefixes) -class abstractopener(object): +class abstractvfs(object): """Abstract base class; cannot be instantiated""" def __init__(self, *args, **kwargs): @@ -219,8 +219,8 @@ def makedirs(self, path=None, mode=None): return util.makedirs(self.join(path), mode) -class opener(abstractopener): - '''Open files relative to a base directory +class vfs(abstractvfs): + '''Operate files relative to a base directory This class is used to hide the details of COW semantics and remote file access from higher level code. @@ -335,8 +335,10 @@ return path.startswith('/') and path or (self.basesep + path) return self.base -class filteropener(abstractopener): - '''Wrapper opener for filtering filenames with a function.''' +opener = vfs + +class filtervfs(abstractvfs): + '''Wrapper vfs for filtering filenames with a function.''' def __init__(self, opener, filter): self._filter = filter @@ -345,6 +347,8 @@ def __call__(self, path, *args, **kwargs): return self._orig(self._filter(path), *args, **kwargs) +filteropener = filtervfs + def canonpath(root, cwd, myname, auditor=None): '''return the canonical path of myname, given cwd and root''' if util.endswithsep(root):