# HG changeset patch # User Pierre-Yves David # Date 2015-10-15 11:45:34 # Node ID 74ff350c208c1600bfa9aebf7956f02922104687 # Parent 634666c48b7db07010ee3e5b7af5575148f49681 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. diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -542,6 +542,13 @@ class obsstore(object): 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