# HG changeset patch # User Pierre-Yves David # Date 1408403324 25200 # Node ID b8a0e8176693ec0845f3d23015dc09f5e1443420 # Parent 4cdc3c333806dac8c8317614e4ae47b1b8dd8587 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". diff -r 4cdc3c333806 -r b8a0e8176693 mercurial/obsolete.py --- a/mercurial/obsolete.py Tue Aug 19 14:42:08 2014 -0700 +++ b/mercurial/obsolete.py Mon Aug 18 16:08:44 2014 -0700 @@ -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)