py3: fix exception in pull when several things happen to a bookmark
Specifically, when `changes` is:
[(b'@upstream-committed', None, <function ui.status>, b'updating bookmark @upstream-committed\n'),
(b'@upstream-committed', binary-node, <function ui.warn>, b'divergent bookmark @ stored as @upstream-committed\n')]
sorting the list raises:
TypeError: '<' not supported between instances of 'bytes' and 'NoneType'
Differential Revision: https://phab.mercurial-scm.org/D8523
--- a/mercurial/bookmarks.py Tue May 12 22:20:56 2020 +0200
+++ b/mercurial/bookmarks.py Thu May 14 10:24:52 2020 -0400
@@ -754,7 +754,8 @@
if changed:
tr = trfunc()
changes = []
- for b, node, writer, msg in sorted(changed):
+ key = lambda t: (t[0], t[1] or b'')
+ for b, node, writer, msg in sorted(changed, key=key):
changes.append((b, node))
writer(msg)
localmarks.applychanges(repo, tr, changes)