[PATCH 2 of 2] py3: fix sorting of obsolete markers during push

Denis Laxalde denis at laxalde.org
Thu Oct 17 07:48:53 EDT 2019


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1571312061 -7200
#      Thu Oct 17 13:34:21 2019 +0200
# Node ID ea1696811e43e868762676d982235244770f25b7
# Parent  4371ba5facb3750101608a38cdbf6c7646ff5fd1
py3: fix sorting of obsolete markers during push

This fixes similar errors as in 01e8eefd9434:

  TypeError: '<' not supported between instances of 'NoneType' and 'tuple'

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
index dfa679b..ce9b65b 100644
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1140,7 +1140,7 @@ def _pushb2obsmarkers(pushop, bundler):
         return
     pushop.stepsdone.add(b'obsmarkers')
     if pushop.outobsmarkers:
-        markers = sorted(pushop.outobsmarkers)
+        markers = _sortedmarkers(pushop.outobsmarkers)
         bundle2.buildobsmarkerspart(bundler, markers)
 
 
@@ -1475,7 +1475,8 @@ def _pushobsolete(pushop):
     if pushop.outobsmarkers:
         pushop.ui.debug(b'try to push obsolete markers to remote\n')
         rslts = []
-        remotedata = obsolete._pushkeyescape(sorted(pushop.outobsmarkers))
+        markers = _sortedmarkers(pushop.outobsmarkers)
+        remotedata = obsolete._pushkeyescape(markers)
         for key in sorted(remotedata, reverse=True):
             # reverse sort to ensure we end with dump0
             data = remotedata[key]


More information about the Mercurial-devel mailing list