py3: work around comparison between int and None in tagmerge
authorYuya Nishihara <yuya@tcha.org>
Sun, 04 Mar 2018 16:23:10 -0500
changeset 36734 b77ff4fbe9ad
parent 36733 66250de006c6
child 36735 ef345f9e4295
py3: work around comparison between int and None in tagmerge
contrib/python3-whitelist
mercurial/tagmerge.py
--- a/contrib/python3-whitelist	Sun Mar 04 16:13:46 2018 -0500
+++ b/contrib/python3-whitelist	Sun Mar 04 16:23:10 2018 -0500
@@ -370,6 +370,7 @@
 test-subrepo-deep-nested-change.t
 test-subrepo.t
 test-symlinks.t
+test-tag.t
 test-treemanifest.t
 test-unamend.t
 test-uncommit.t
--- a/mercurial/tagmerge.py	Sun Mar 04 16:13:46 2018 -0500
+++ b/mercurial/tagmerge.py	Sun Mar 04 16:23:10 2018 -0500
@@ -73,8 +73,6 @@
 
 from __future__ import absolute_import
 
-import operator
-
 from .i18n import _
 from .node import (
     hex,
@@ -164,7 +162,7 @@
     # before writing them
     # the position is calculated to ensure that the diff of the merged .hgtags
     # file to the first parent's .hgtags file is as small as possible
-    finaltags.sort(key=operator.itemgetter(0))
+    finaltags.sort(key=lambda x: -1 if x[0] is None else x[0])
 
     # finally we can join the sorted groups to get the final contents of the
     # merged .hgtags file, and then write it to disk