Comments
Patch
@@ -460,10 +460,20 @@ class marker(object):
def flags(self):
"""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
Markers can be accessed with two mappings:
- precursors[x] -> set(markers on precursors edges of x)
@@ -596,13 +606,12 @@ class obsstore(object):
self.precursors.setdefault(suc, set()).add(mark)
parents = mark[5]
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.
"relevant" to a set of nodes mean: