##// END OF EJS Templates
obsstore: add a `parents` field...
Pierre-Yves David -
r22254:b8a0e817 default
parent child Browse files
Show More
@@ -173,7 +173,7 b' def _readmarkers(data):'
173 173 except util.Abort:
174 174 date = (0., 0)
175 175
176 yield (pre, sucs, flags, metadata, date)
176 yield (pre, sucs, flags, metadata, date, None)
177 177
178 178 def encodemeta(meta):
179 179 """Return encoded metadata string to string mapping.
@@ -242,12 +242,14 b' class obsstore(object):'
242 242 - successors[x] -> set(markers on successors edges of x)
243 243 """
244 244
245 fields = ('prec', 'succs', 'flag', 'meta', 'date')
246 # prec: nodeid, precursor changesets
247 # succs: tuple of nodeid, successor changesets (0-N length)
248 # flag: integer, flag field carrying modifier for the markers (see doc)
249 # meta: binary blob, encoded metadata dictionary
250 # date: (float, int) tuple, date of marker creation
245 fields = ('prec', 'succs', 'flag', 'meta', 'date', 'parents')
246 # prec: nodeid, precursor changesets
247 # succs: tuple of nodeid, successor changesets (0-N length)
248 # flag: integer, flag field carrying modifier for the markers (see doc)
249 # meta: binary blob, encoded metadata dictionary
250 # date: (float, int) tuple, date of marker creation
251 # parents: (tuple of nodeid) or None, parents of precursors
252 # None is used when no data has been recorded
251 253
252 254 def __init__(self, sopener):
253 255 # caches for various obsolescence related cache
@@ -300,7 +302,7 b' class obsstore(object):'
300 302 if prec in succs:
301 303 raise ValueError(_('in-marker cycle with %s') % node.hex(prec))
302 304 marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata),
303 date)
305 date, None)
304 306 return bool(self.add(transaction, [marker]))
305 307
306 308 def add(self, transaction, markers):
@@ -364,7 +366,7 b' def _encodemarkers(markers, addheader=Fa'
364 366
365 367
366 368 def _encodeonemarker(marker):
367 pre, sucs, flags, metadata, date = marker
369 pre, sucs, flags, metadata, date, parents = marker
368 370 metadata = decodemeta(metadata)
369 371 metadata['date'] = '%d %i' % date
370 372 metadata = encodemeta(metadata)
General Comments 0
You need to be logged in to leave comments. Login now