checkheads: do not overwrite code for Mercurial 4.2 and above stable
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Thu, 20 Apr 2017 11:40:08 +0200
branchstable
changeset 2274 72ba9d4418e0
parent 2273 228111491788
child 2275 fff7a678f659
checkheads: do not overwrite code for Mercurial 4.2 and above The fix has been ported to Mercurial core as c6cb21ddf74a.
README
hgext3rd/evolve/checkheads.py
--- a/README	Thu Apr 20 00:21:13 2017 +0900
+++ b/README	Thu Apr 20 11:40:08 2017 +0200
@@ -116,8 +116,9 @@
 6.0.1 - in progress
 -------------------
 
- - template: adapt to change in 4.2
+ - template: adapt to change in 4.2,
  - fix 'debugrecordpruneparents' (outdated API usage)
+ - checkheads: give priority to updated 4.2 code,
 
 6.0.0 -- 2017-02-31
 -------------------
--- a/hgext3rd/evolve/checkheads.py	Thu Apr 20 00:21:13 2017 +0900
+++ b/hgext3rd/evolve/checkheads.py	Thu Apr 20 11:40:08 2017 +0200
@@ -30,10 +30,8 @@
 
 @eh.uisetup
 def setupcheckheadswrapper(ui):
-    if util.safehasattr(discovery, '_postprocessobsolete'):
-        extensions.wrapfunction(discovery, '_postprocessobsolete',
-                                checkheadslightoverlay)
-    else:
+    if not util.safehasattr(discovery, '_postprocessobsolete'):
+        # hg-4.2+ has all the code natively
         extensions.wrapfunction(discovery, 'checkheads',
                                 checkheadsfulloverlay)
 
@@ -44,9 +42,6 @@
     else:
         return orig(pushop)
 
-def checkheadslightoverlay(orig, *args, **kwargs):
-    return _postprocessobsolete(*args, **kwargs)
-
 # copied from mercurial.discovery.checkheads as in a5bad127128d (4.1)
 #
 # The only differences are: