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