rename path_auditor to pathauditor

The Mercurial 1.9 release is moving a lot of stuff around anyway and we are
already moving path_auditor from util.py to scmutil.py for that release.

So this seems like a good opportunity to do such a rename. It also strengthens
the current project policy to avoid underbars in names.
This commit is contained in:
Adrian Buehlmann 2011-05-06 09:54:06 +02:00
parent d04646b8d9
commit e981d64ef2
6 changed files with 8 additions and 8 deletions

View File

@ -286,7 +286,7 @@ def addremove(repo, pats=[], opts={}, dry_run=None, similarity=None):
similarity = float(opts.get('similarity') or 0)
# we'd use status here, except handling of symlinks and ignore is tricky
added, unknown, deleted, removed = [], [], [], []
audit_path = scmutil.path_auditor(repo.root)
audit_path = scmutil.pathauditor(repo.root)
m = match(repo, pats, opts)
for abs in repo.walk(m):
target = repo.wjoin(abs)

View File

@ -3618,7 +3618,7 @@ def revert(ui, repo, *pats, **opts):
fc = ctx[f]
repo.wwrite(f, fc.data(), fc.flags())
audit_path = scmutil.path_auditor(repo.root)
audit_path = scmutil.pathauditor(repo.root)
for f in remove[0]:
if repo.dirstate[f] == 'a':
repo.dirstate.forget(f)

View File

@ -30,7 +30,7 @@ class localrepository(repo.repository):
self.root = os.path.realpath(util.expandpath(path))
self.path = os.path.join(self.root, ".hg")
self.origroot = path
self.auditor = scmutil.path_auditor(self.root, self._checknested)
self.auditor = scmutil.pathauditor(self.root, self._checknested)
self.opener = scmutil.opener(self.path)
self.wopener = scmutil.opener(self.root)
self.baseui = baseui

View File

@ -302,7 +302,7 @@ def applyupdates(repo, action, wctx, mctx, actx, overwrite):
repo.ui.debug("removing %s\n" % f)
os.unlink(repo.wjoin(f))
audit_path = scmutil.path_auditor(repo.root)
audit_path = scmutil.pathauditor(repo.root)
numupdates = len(action)
for i, a in enumerate(action):

View File

@ -57,7 +57,7 @@ class casecollisionauditor(object):
self._ui.warn(_("warning: %s\n") % msg)
map[fl] = f
class path_auditor(object):
class pathauditor(object):
'''ensure that a filesystem path contains no banned components.
the following properties of a path are checked:
@ -169,7 +169,7 @@ class opener(abstractopener):
def __init__(self, base, audit=True):
self.base = base
if audit:
self.auditor = path_auditor(base)
self.auditor = pathauditor(base)
else:
self.auditor = util.always
self.createmode = None
@ -276,7 +276,7 @@ def canonpath(root, cwd, myname, auditor=None):
name = os.path.join(root, cwd, name)
name = os.path.normpath(name)
if auditor is None:
auditor = path_auditor(root)
auditor = pathauditor(root)
if name != rootsep and name.startswith(rootsep):
name = name[len(rootsep):]
auditor(name)

View File

@ -235,7 +235,7 @@ def subrepo(ctx, path):
import hg as h
hg = h
scmutil.path_auditor(ctx._repo.root)(path)
scmutil.pathauditor(ctx._repo.root)(path)
state = ctx.substate.get(path, nullstate)
if state[2] not in types:
raise util.Abort(_('unknown subrepo type %s') % state[2])