# HG changeset patch # User Adrian Buehlmann # Date 1304668446 -7200 # Node ID 21b8ce4d33318dc916659bd62c706cdfadf7eb34 # Parent c33427080671119a7b91ad2fade2aff564594a4a 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. diff -r c33427080671 -r 21b8ce4d3331 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Fri May 06 12:09:20 2011 +0200 +++ b/mercurial/cmdutil.py Fri May 06 09:54:06 2011 +0200 @@ -286,7 +286,7 @@ 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) diff -r c33427080671 -r 21b8ce4d3331 mercurial/commands.py --- a/mercurial/commands.py Fri May 06 12:09:20 2011 +0200 +++ b/mercurial/commands.py Fri May 06 09:54:06 2011 +0200 @@ -3618,7 +3618,7 @@ 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) diff -r c33427080671 -r 21b8ce4d3331 mercurial/localrepo.py --- a/mercurial/localrepo.py Fri May 06 12:09:20 2011 +0200 +++ b/mercurial/localrepo.py Fri May 06 09:54:06 2011 +0200 @@ -30,7 +30,7 @@ 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 diff -r c33427080671 -r 21b8ce4d3331 mercurial/merge.py --- a/mercurial/merge.py Fri May 06 12:09:20 2011 +0200 +++ b/mercurial/merge.py Fri May 06 09:54:06 2011 +0200 @@ -302,7 +302,7 @@ 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): diff -r c33427080671 -r 21b8ce4d3331 mercurial/scmutil.py --- a/mercurial/scmutil.py Fri May 06 12:09:20 2011 +0200 +++ b/mercurial/scmutil.py Fri May 06 09:54:06 2011 +0200 @@ -57,7 +57,7 @@ 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 @@ 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 @@ 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) diff -r c33427080671 -r 21b8ce4d3331 mercurial/subrepo.py --- a/mercurial/subrepo.py Fri May 06 12:09:20 2011 +0200 +++ b/mercurial/subrepo.py Fri May 06 09:54:06 2011 +0200 @@ -235,7 +235,7 @@ 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])