# HG changeset patch # User Pierre-Yves David # Date 2015-01-30 18:49:33 # Node ID 18d431147cc133dbcd255b90944d2d6b1288268b # Parent c408bf3b32f8126b7bf1fa401d5746c51edfa5e6 obsstore: make the invalid markers check wrap-able Some evolve user ignored the invalid markers for about two years and still have some of them in some repository. This lead to plain abort whenever mercurial try to open such repo. We need reinstall some way to clean this up in the evolve extension. For this purpose, we need the checker code wrap-able independently. This is scheduled for stable as this issue is blocking some evolve user. diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -462,6 +462,16 @@ class marker(object): """The flags field of the marker""" return self._data[2] +def _checkinvalidmarkers(obsstore): + """search for marker with invalid data and raise error if needed + + Exist as a separated function to allow the evolve extension for a more + subtle handling. + """ + if node.nullid in obsstore.precursors: + raise util.Abort(_('bad obsolescence marker detected: ' + 'invalid successors nullid')) + class obsstore(object): """Store obsolete markers @@ -598,9 +608,8 @@ class obsstore(object): if parents is not None: for p in parents: self.children.setdefault(p, set()).add(mark) - if node.nullid in self.precursors: - raise util.Abort(_('bad obsolescence marker detected: ' - 'invalid successors nullid')) + _checkinvalidmarkers(self) + def relevantmarkers(self, nodes): """return a set of all obsolescence markers relevant to a set of nodes.