equal
deleted
inserted
replaced
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> |