[PATCH] rename path_auditor to pathauditor

Adrian Buehlmann adrian at cadifra.com
Fri May 6 06:13:32 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1304668446 -7200
# Node ID 7bc5a0169375a3a10024bd3839894dabb7072853
# Parent  d62d597b8974574686b13dfb2f2c97500fa9212f
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 --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -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 --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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 --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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 --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -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 --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -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 --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -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])


More information about the Mercurial-devel mailing list