Show More
@@ -12,7 +12,6 b' import hashlib' | |||||
12 |
|
12 | |||
13 | from .i18n import _ |
|
13 | from .i18n import _ | |
14 | from .node import ( |
|
14 | from .node import ( | |
15 | bin, |
|
|||
16 | hex, |
|
15 | hex, | |
17 | nullid, |
|
16 | nullid, | |
18 | nullrev, |
|
17 | nullrev, | |
@@ -441,7 +440,7 b' class pushoperation(object):' | |||||
441 | self.fallbackoutdatedphases = None |
|
440 | self.fallbackoutdatedphases = None | |
442 | # outgoing obsmarkers |
|
441 | # outgoing obsmarkers | |
443 | self.outobsmarkers = set() |
|
442 | self.outobsmarkers = set() | |
444 | # outgoing bookmarks |
|
443 | # outgoing bookmarks, list of (bm, oldnode | '', newnode | '') | |
445 | self.outbookmarks = [] |
|
444 | self.outbookmarks = [] | |
446 | # transaction manager |
|
445 | # transaction manager | |
447 | self.trmanager = None |
|
446 | self.trmanager = None | |
@@ -716,17 +715,6 b' def _pushdiscoverybookmarks(pushop):' | |||||
716 |
|
715 | |||
717 | remotebookmark = bookmod.unhexlifybookmarks(remotebookmark) |
|
716 | remotebookmark = bookmod.unhexlifybookmarks(remotebookmark) | |
718 | comp = bookmod.comparebookmarks(repo, repo._bookmarks, remotebookmark) |
|
717 | comp = bookmod.comparebookmarks(repo, repo._bookmarks, remotebookmark) | |
719 |
|
||||
720 | def safehex(x): |
|
|||
721 | if x is None: |
|
|||
722 | return x |
|
|||
723 | return hex(x) |
|
|||
724 |
|
||||
725 | def hexifycompbookmarks(bookmarks): |
|
|||
726 | return [(b, safehex(scid), safehex(dcid)) |
|
|||
727 | for (b, scid, dcid) in bookmarks] |
|
|||
728 |
|
||||
729 | comp = [hexifycompbookmarks(marks) for marks in comp] |
|
|||
730 | return _processcompared(pushop, ancestors, explicit, remotebookmark, comp) |
|
718 | return _processcompared(pushop, ancestors, explicit, remotebookmark, comp) | |
731 |
|
719 | |||
732 | def _processcompared(pushop, pushed, explicit, remotebms, comp): |
|
720 | def _processcompared(pushop, pushed, explicit, remotebms, comp): | |
@@ -877,7 +865,6 b' def _pushb2checkbookmarks(pushop, bundle' | |||||
877 | return |
|
865 | return | |
878 | data = [] |
|
866 | data = [] | |
879 | for book, old, new in pushop.outbookmarks: |
|
867 | for book, old, new in pushop.outbookmarks: | |
880 | old = bin(old) |
|
|||
881 | data.append((book, old)) |
|
868 | data.append((book, old)) | |
882 | checkdata = bookmod.binaryencode(data) |
|
869 | checkdata = bookmod.binaryencode(data) | |
883 | bundler.newpart('check:bookmarks', data=checkdata) |
|
870 | bundler.newpart('check:bookmarks', data=checkdata) | |
@@ -1051,7 +1038,6 b' def _pushb2bookmarkspart(pushop, bundler' | |||||
1051 | data = [] |
|
1038 | data = [] | |
1052 | for book, old, new in pushop.outbookmarks: |
|
1039 | for book, old, new in pushop.outbookmarks: | |
1053 | _abortonsecretctx(pushop, new, book) |
|
1040 | _abortonsecretctx(pushop, new, book) | |
1054 | new = bin(new) |
|
|||
1055 | data.append((book, new)) |
|
1041 | data.append((book, new)) | |
1056 | allactions.append((book, _bmaction(old, new))) |
|
1042 | allactions.append((book, _bmaction(old, new))) | |
1057 | checkdata = bookmod.binaryencode(data) |
|
1043 | checkdata = bookmod.binaryencode(data) | |
@@ -1083,8 +1069,8 b' def _pushb2bookmarkspushkey(pushop, bund' | |||||
1083 | part = bundler.newpart('pushkey') |
|
1069 | part = bundler.newpart('pushkey') | |
1084 | part.addparam('namespace', enc('bookmarks')) |
|
1070 | part.addparam('namespace', enc('bookmarks')) | |
1085 | part.addparam('key', enc(book)) |
|
1071 | part.addparam('key', enc(book)) | |
1086 | part.addparam('old', enc(old)) |
|
1072 | part.addparam('old', enc(hex(old))) | |
1087 | part.addparam('new', enc(new)) |
|
1073 | part.addparam('new', enc(hex(new))) | |
1088 | action = 'update' |
|
1074 | action = 'update' | |
1089 | if not old: |
|
1075 | if not old: | |
1090 | action = 'export' |
|
1076 | action = 'export' | |
@@ -1339,8 +1325,8 b' def _pushbookmark(pushop):' | |||||
1339 | r = e.callcommand('pushkey', { |
|
1325 | r = e.callcommand('pushkey', { | |
1340 | 'namespace': 'bookmarks', |
|
1326 | 'namespace': 'bookmarks', | |
1341 | 'key': b, |
|
1327 | 'key': b, | |
1342 | 'old': old, |
|
1328 | 'old': hex(old), | |
1343 | 'new': new, |
|
1329 | 'new': hex(new), | |
1344 | }).result() |
|
1330 | }).result() | |
1345 |
|
1331 | |||
1346 | if r: |
|
1332 | if r: |
General Comments 0
You need to be logged in to leave comments.
Login now