##// END OF EJS Templates
obsstore: move header encoding to a separate function...
Jun Wu -
r32692:9576974a default
parent child Browse files
Show More
@@ -452,12 +452,15 b' def _readmarkers(data):'
452 raise error.UnknownVersion(msg, version=diskversion)
452 raise error.UnknownVersion(msg, version=diskversion)
453 return diskversion, formats[diskversion][0](data, off)
453 return diskversion, formats[diskversion][0](data, off)
454
454
455 def encodeheader(version=_fm0version):
456 return _pack('>B', version)
457
455 def encodemarkers(markers, addheader=False, version=_fm0version):
458 def encodemarkers(markers, addheader=False, version=_fm0version):
456 # Kept separate from flushmarkers(), it will be reused for
459 # Kept separate from flushmarkers(), it will be reused for
457 # markers exchange.
460 # markers exchange.
458 encodeone = formats[version][1]
461 encodeone = formats[version][1]
459 if addheader:
462 if addheader:
460 yield _pack('>B', version)
463 yield encodeheader(version)
461 for marker in markers:
464 for marker in markers:
462 yield encodeone(marker)
465 yield encodeone(marker)
463
466
General Comments 0
You need to be logged in to leave comments. Login now