From e981d64ef2ad968577410bddeabaa239eb05fec0 Mon Sep 17 00:00:00 2001 From: Adrian Buehlmann Date: Fri, 6 May 2011 09:54:06 +0200 Subject: [PATCH] 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. --- mercurial/cmdutil.py | 2 +- mercurial/commands.py | 2 +- mercurial/localrepo.py | 2 +- mercurial/merge.py | 2 +- mercurial/scmutil.py | 6 +++--- mercurial/subrepo.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py index ccf86267bf..a741fd0e71 100644 --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -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) diff --git a/mercurial/commands.py b/mercurial/commands.py index 551c8f10b3..90d6f71f25 100644 --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -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) diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py index b52113242c..3009884e16 100644 --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -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 diff --git a/mercurial/merge.py b/mercurial/merge.py index 1d20bd2f0f..f152349741 100644 --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -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): diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py index cb028fcc5b..9fb528210f 100644 --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -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) diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py index 2da57a2622..9f7334d8f5 100644 --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -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])