obsstore: make the readonly attribute accessible
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 15 Oct 2015 12:45:34 +0100
changeset 26684 74ff350c208c
parent 26683 634666c48b7d
child 26685 ea390d889d3a
obsstore: make the readonly attribute accessible We want to gracefully handle the read only case in some case (current target: advisory obsmarkers parts in bundle2). So we expose the attribute in a clean way.
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Mon Oct 05 04:26:26 2015 -0700
+++ b/mercurial/obsolete.py	Thu Oct 15 12:45:34 2015 +0100
@@ -542,6 +542,13 @@
                 pass
         return bool(self._all)
 
+    @property
+    def readonly(self):
+        """True if marker creation is disabled
+
+        Remove me in the future when obsolete marker is always on."""
+        return self._readonly
+
     def create(self, transaction, prec, succs=(), flag=0, parents=None,
                date=None, metadata=None):
         """obsolete: add a new obsolete marker