evolve: add compat for repair.stripbmrevset which is moved to scmutil stable
authorPulkit Goyal <7895pulkit@gmail.com>
Thu, 24 May 2018 01:50:26 +0530
branchstable
changeset 3767 115caa4e5278
parent 3766 6352dc395ebf
child 3768 482195001997
child 3775 fa7b94606024
evolve: add compat for repair.stripbmrevset which is moved to scmutil This patch adds compatibility logic for repair.stripbmrevset() which is moved to scmutil as bookmarkrevs(). This fixes test-prune.t failure.
hgext3rd/evolve/compat.py
hgext3rd/evolve/rewriteutil.py
--- a/hgext3rd/evolve/compat.py	Wed May 23 11:18:14 2018 +0200
+++ b/hgext3rd/evolve/compat.py	Thu May 24 01:50:26 2018 +0530
@@ -13,7 +13,9 @@
     mdiff,
     obsolete,
     obsutil,
+    repair,
     revset,
+    scmutil,
     util,
     vfs as vfsmod,
 )
@@ -195,6 +197,14 @@
 except (ImportError, AttributeError):
     updateresult = None
 
+# 46c2b19a1263f18a5829a21b7a5053019b0c5a31 in hg moved repair.stripbmrevset to
+# scmutil.bookmarkrevs
+# This change is a part of 4.7 cycle, so drop this when we drop support for 4.6
+try:
+    bmrevset = repair.stripbmrevset
+except AttributeError:
+    bmrevset = scmutil.bookmarkrevs
+
 def hasconflict(upres):
     if updateresult is None:
         return bool(upres[-1])
--- a/hgext3rd/evolve/rewriteutil.py	Wed May 23 11:18:14 2018 +0200
+++ b/hgext3rd/evolve/rewriteutil.py	Thu May 24 01:50:26 2018 +0530
@@ -22,7 +22,6 @@
     node,
     obsolete,
     phases,
-    repair,
     revset,
     util,
 )
@@ -155,7 +154,7 @@
         nodetobookmarks.setdefault(bnode, []).append(mark)
     for marks in nodetobookmarks.values():
         if bookmarks.issuperset(marks):
-            rsrevs = repair.stripbmrevset(repo, marks[0])
+            rsrevs = compat.bmrevset(repo, marks[0])
             revs = set(revs)
             revs.update(set(rsrevs))
             revs = sorted(revs)