changeset 5910:efdbbced2374

compat: make compatible with upstream change to put nullid on repo This patch makes evolve compatible across Mercurial core commit d55b71393907.
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 04 May 2021 09:39:45 -0700
parents e24bdf74cf83
children 55589cb47581
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Sun Apr 25 23:52:29 2021 +0800
+++ b/hgext3rd/evolve/__init__.py	Tue May 04 09:39:45 2021 -0700
@@ -1039,16 +1039,23 @@
                      _(b"make commit obsolete this revision (DEPRECATED)")))
 
 @eh.wrapfunction(obsolete, '_checkinvalidmarkers')
-def _checkinvalidmarkers(orig, markers):
+def _checkinvalidmarkers(orig, *args):
     """search for marker with invalid data and raise error if needed
 
     Exist as a separated function to allow the evolve extension for a more
     subtle handling.
     """
+    if len(args) == 2:
+        repo_nullid = args[0].nullid
+        markers = args[1]
+    else:
+        # hg <= 5.8 (d55b71393907)
+        repo_nullid = nullid
+        markers = args[0]
     if r'debugobsconvert' in sys.argv:
         return
     for mark in markers:
-        if nullid in mark[1]:
+        if repo_nullid in mark[1]:
             msg = _(b'bad obsolescence marker detected: invalid successors nullid')
             hint = _(b'You should run `hg debugobsconvert`')
             raise error.Abort(msg, hint=hint)