[Request] [+ ] D8523: py3: fix exception in pull when several things happen to a bookmark
valentin.gatienbaron (Valentin Gatien-Baron)
phabricator at mercurial-scm.org
Thu May 14 15:00:11 UTC 2020
valentin.gatienbaron created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
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'
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D8523
AFFECTED FILES
mercurial/bookmarks.py
CHANGE DETAILS
diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -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)
To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200514/b400a9e4/attachment.html>
More information about the Mercurial-patches
mailing list