diff --git a/mercurial/util.py b/mercurial/util.py
index 49463314c24f4be58a07f7ecc85c80f91815c3bc_bWVyY3VyaWFsL3V0aWwucHk=..ff6f5310ad92a04e19fd3ed072800431f55b511d_bWVyY3VyaWFsL3V0aWwucHk= 100644
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -292,7 +292,7 @@
     b.reverse()
     return os.sep.join((['..'] * len(a)) + b) or '.'
 
-def canonpath(root, cwd, myname):
+def canonpath(root, cwd, myname, audit_path=None):
     """return the canonical path of myname, given cwd and root"""
     if endswithsep(root):
         rootsep = root
@@ -302,7 +302,8 @@
     if not os.path.isabs(name):
         name = os.path.join(root, cwd, name)
     name = os.path.normpath(name)
-    audit_path = path_auditor(root)
+    if audit_path is None:
+        audit_path = path_auditor(root)
     if name != rootsep and name.startswith(rootsep):
         name = name[len(rootsep):]
         audit_path(name)