util: use 'auditor' as consistent name for path auditors
authorMartin Geisler <mg@lazybytes.net>
Sun, 29 Aug 2010 23:56:19 +0200
changeset 12078 e03ca36ba9f3
parent 12077 ff6f5310ad92
child 12079 41e56e07eef5
util: use 'auditor' as consistent name for path auditors
mercurial/util.py
--- a/mercurial/util.py	Sun Aug 29 23:56:19 2010 +0200
+++ b/mercurial/util.py	Sun Aug 29 23:56:19 2010 +0200
@@ -292,7 +292,7 @@
     b.reverse()
     return os.sep.join((['..'] * len(a)) + b) or '.'
 
-def canonpath(root, cwd, myname, audit_path=None):
+def canonpath(root, cwd, myname, auditor=None):
     """return the canonical path of myname, given cwd and root"""
     if endswithsep(root):
         rootsep = root
@@ -302,11 +302,11 @@
     if not os.path.isabs(name):
         name = os.path.join(root, cwd, name)
     name = os.path.normpath(name)
-    if audit_path is None:
-        audit_path = path_auditor(root)
+    if auditor is None:
+        auditor = path_auditor(root)
     if name != rootsep and name.startswith(rootsep):
         name = name[len(rootsep):]
-        audit_path(name)
+        auditor(name)
         return pconvert(name)
     elif name == root:
         return ''
@@ -330,7 +330,7 @@
                     return ''
                 rel.reverse()
                 name = os.path.join(*rel)
-                audit_path(name)
+                auditor(name)
                 return pconvert(name)
             dirname, basename = os.path.split(name)
             rel.append(basename)
@@ -836,9 +836,9 @@
     def __init__(self, base, audit=True):
         self.base = base
         if audit:
-            self.audit_path = path_auditor(base)
+            self.auditor = path_auditor(base)
         else:
-            self.audit_path = always
+            self.auditor = always
         self.createmode = None
 
     @propertycache
@@ -851,7 +851,7 @@
         os.chmod(name, self.createmode & 0666)
 
     def __call__(self, path, mode="r", text=False, atomictemp=False):
-        self.audit_path(path)
+        self.auditor(path)
         f = os.path.join(self.base, path)
 
         if not text and "b" not in mode:
@@ -876,7 +876,7 @@
         return fp
 
     def symlink(self, src, dst):
-        self.audit_path(dst)
+        self.auditor(dst)
         linkname = os.path.join(self.base, dst)
         try:
             os.unlink(linkname)