mercurial/bookmarks.py
changeset 46780 6266d19556ad
parent 45942 89a2afe31e82
child 46907 ffd3e823a7e5
equal deleted inserted replaced
46779:49fd21f32695 46780:6266d19556ad
   621 
   621 
   622 
   622 
   623 _binaryentry = struct.Struct(b'>20sH')
   623 _binaryentry = struct.Struct(b'>20sH')
   624 
   624 
   625 
   625 
   626 def binaryencode(bookmarks):
   626 def binaryencode(repo, bookmarks):
   627     """encode a '(bookmark, node)' iterable into a binary stream
   627     """encode a '(bookmark, node)' iterable into a binary stream
   628 
   628 
   629     the binary format is:
   629     the binary format is:
   630 
   630 
   631         <node><bookmark-length><bookmark-name>
   631         <node><bookmark-length><bookmark-name>
   643         binarydata.append(_binaryentry.pack(node, len(book)))
   643         binarydata.append(_binaryentry.pack(node, len(book)))
   644         binarydata.append(book)
   644         binarydata.append(book)
   645     return b''.join(binarydata)
   645     return b''.join(binarydata)
   646 
   646 
   647 
   647 
   648 def binarydecode(stream):
   648 def binarydecode(repo, stream):
   649     """decode a binary stream into an '(bookmark, node)' iterable
   649     """decode a binary stream into an '(bookmark, node)' iterable
   650 
   650 
   651     the binary format is:
   651     the binary format is:
   652 
   652 
   653         <node><bookmark-length><bookmark-name>
   653         <node><bookmark-length><bookmark-name>