mercurial/obsolete.py
changeset 22846 b1efc4893da4
parent 22845 ef880e28e56a
child 22847 37460ee2003c
equal deleted inserted replaced
22845:ef880e28e56a 22846:b1efc4893da4
   199         if not parents:
   199         if not parents:
   200             # mark that we explicitly recorded no parents
   200             # mark that we explicitly recorded no parents
   201             metadata['p0'] = ''
   201             metadata['p0'] = ''
   202         for i, p in enumerate(parents):
   202         for i, p in enumerate(parents):
   203             metadata['p%i' % (i + 1)] = node.hex(p)
   203             metadata['p%i' % (i + 1)] = node.hex(p)
   204     metadata = encodemeta(metadata)
   204     metadata = _fm0encodemeta(metadata)
   205     numsuc = len(sucs)
   205     numsuc = len(sucs)
   206     format = _fm0fixed + (_fm0node * numsuc)
   206     format = _fm0fixed + (_fm0node * numsuc)
   207     data = [numsuc, len(metadata), flags, pre]
   207     data = [numsuc, len(metadata), flags, pre]
   208     data.extend(sucs)
   208     data.extend(sucs)
   209     return _pack(format, *data) + metadata
   209     return _pack(format, *data) + metadata
   230         yield _pack('>B', version)
   230         yield _pack('>B', version)
   231     for marker in markers:
   231     for marker in markers:
   232         yield encodeone(marker)
   232         yield encodeone(marker)
   233 
   233 
   234 
   234 
   235 def encodemeta(meta):
   235 def _fm0encodemeta(meta):
   236     """Return encoded metadata string to string mapping.
   236     """Return encoded metadata string to string mapping.
   237 
   237 
   238     Assume no ':' in key and no '\0' in both key and value."""
   238     Assume no ':' in key and no '\0' in both key and value."""
   239     for key, value in meta.iteritems():
   239     for key, value in meta.iteritems():
   240         if ':' in key or '\0' in key:
   240         if ':' in key or '\0' in key: