changeset 14720:36283a7b6856 stable

opener: add self._audit (issue2862)
author Adrian Buehlmann <adrian@cadifra.com>
date Wed, 22 Jun 2011 10:13:44 +0200
parents c19de7f32961
children 4fcde634f5e0
files mercurial/scmutil.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)