changeset 3767:115caa4e5278 stable

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.
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 24 May 2018 01:50:26 +0530
parents 6352dc395ebf
children 482195001997 fa7b94606024
files hgext3rd/evolve/compat.py hgext3rd/evolve/rewriteutil.py
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)