opener: add self._audit (issue2862) stable
authorAdrian Buehlmann <adrian@cadifra.com>
Wed, 22 Jun 2011 10:13:44 +0200
branchstable
changeset 14720 36283a7b6856
parent 14719 c19de7f32961
child 14721 4fcde634f5e0
opener: add self._audit (issue2862)
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Wed Jun 22 17:13:04 2011 +0300
+++ b/mercurial/scmutil.py	Wed Jun 22 10:13:44 2011 +0200
@@ -169,6 +169,7 @@
     '''
     def __init__(self, base, audit=True):
         self.base = base
+        self._audit = audit
         if audit:
             self.auditor = pathauditor(base)
         else:
@@ -186,9 +187,10 @@
         os.chmod(name, self.createmode & 0666)
 
     def __call__(self, path, mode="r", text=False, atomictemp=False):
-        r = util.checkosfilename(path)
-        if r:
-            raise util.Abort("%s: %r" % (r, path))
+        if self._audit:
+            r = util.checkosfilename(path)
+            if r:
+                raise util.Abort("%s: %r" % (r, path))
         self.auditor(path)
         f = os.path.join(self.base, path)