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

login
register
mail settings
Submitter Denis Laxalde
Date Oct. 17, 2019, 11:48 a.m.
Message ID <ea1696811e43e8687626.1571312933@steppe.local>
Download mbox | patch
Permalink /patch/42450/
State Accepted
Headers show

Comments

Denis Laxalde - Oct. 17, 2019, 11:48 a.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@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'

Patch

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]