[PATCH 01 of 10] scmutil: turn opener._audit into a property, mustaudit

Bryan O'Sullivan bos at serpentine.com
Thu Sep 13 14:01:14 CDT 2012


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1347562628 25200
# Node ID 5d2ae7e9a2bc1dac14143ac9e9a3885ba0049139
# Parent  f2bcc5975f108027629ac6d8179d0e4a1cb74ad8
scmutil: turn opener._audit into a property, mustaudit

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -229,13 +229,21 @@
         if expand:
             base = os.path.realpath(util.expandpath(base))
         self.base = base
-        self._audit = audit
-        if audit:
-            self.auditor = pathauditor(base)
+        self._setmustaudit(audit)
+        self.createmode = None
+        self._trustnlink = None
+
+    def _getmustaudit(self):
+        return self._audit
+
+    def _setmustaudit(self, onoff):
+        self._audit = onoff
+        if onoff:
+            self.auditor = pathauditor(self.base)
         else:
             self.auditor = util.always
-        self.createmode = None
-        self._trustnlink = None
+
+    mustaudit = property(_getmustaudit, _setmustaudit)
 
     @util.propertycache
     def _cansymlink(self):


More information about the Mercurial-devel mailing list