Skip to content
Snippets Groups Projects
Commit b8a0e817 authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

obsstore: add a `parents` field

This field is intended to store the parent of the precursor. This is useful to
attach pruned changesets to a set of exchanged changesets. We currently just
add the fields with a None value. None stands for "no data recorded".
parent 4cdc3c33
No related branches found
No related tags found
No related merge requests found
......@@ -173,7 +173,7 @@
except util.Abort:
date = (0., 0)
yield (pre, sucs, flags, metadata, date)
yield (pre, sucs, flags, metadata, date, None)
def encodemeta(meta):
"""Return encoded metadata string to string mapping.
......@@ -242,12 +242,14 @@
- successors[x] -> set(markers on successors edges of x)
"""
fields = ('prec', 'succs', 'flag', 'meta', 'date')
# prec: nodeid, precursor changesets
# succs: tuple of nodeid, successor changesets (0-N length)
# flag: integer, flag field carrying modifier for the markers (see doc)
# meta: binary blob, encoded metadata dictionary
# date: (float, int) tuple, date of marker creation
fields = ('prec', 'succs', 'flag', 'meta', 'date', 'parents')
# prec: nodeid, precursor changesets
# succs: tuple of nodeid, successor changesets (0-N length)
# flag: integer, flag field carrying modifier for the markers (see doc)
# meta: binary blob, encoded metadata dictionary
# date: (float, int) tuple, date of marker creation
# parents: (tuple of nodeid) or None, parents of precursors
# None is used when no data has been recorded
def __init__(self, sopener):
# caches for various obsolescence related cache
......@@ -300,7 +302,7 @@
if prec in succs:
raise ValueError(_('in-marker cycle with %s') % node.hex(prec))
marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata),
date)
date, None)
return bool(self.add(transaction, [marker]))
def add(self, transaction, markers):
......@@ -364,7 +366,7 @@
def _encodeonemarker(marker):
pre, sucs, flags, metadata, date = marker
pre, sucs, flags, metadata, date, parents = marker
metadata = decodemeta(metadata)
metadata['date'] = '%d %i' % date
metadata = encodemeta(metadata)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment