diff hgext3rd/topic/__init__.py @ 2909:9ce092b17530

convertbookmark: properly convert stacked bookmarks We ignores pure descendant when looking for revision to convert. This adds support for cases were a linear stack contains multiple bookmark (or un-bookmarked descendants exists). In this case, some changeset are left orphan, but we'll consider the issue as minor for now.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Sep 2017 17:15:55 +0200
parents 95bb27b8918c
children 1341ff3ba4a9
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Fri Sep 01 18:46:10 2017 +0200
+++ b/hgext3rd/topic/__init__.py	Fri Sep 01 17:15:55 2017 +0200
@@ -522,14 +522,13 @@
 CONVERTBOOKREVSET = """
 not public() and (
     ancestors(bookmark(%s))
-    and not (
-        ancestors(
-            head()
-            and not bookmark(%s)
-        )
-        or ancestors(
-            bookmark()
-            and not bookmark(%s)
+    and not ancestors(
+        (
+            (head() and not bookmark(%s))
+            or (bookmark() - bookmark(%s))
+        ) - (
+            descendants(bookmark(%s))
+            - bookmark(%s)
         )
     )
 )
@@ -540,7 +539,7 @@
 
     find all changesets under the bookmark and under that bookmark only.
     """
-    return repo.revs(CONVERTBOOKREVSET, bmark, bmark, bmark)
+    return repo.revs(CONVERTBOOKREVSET, bmark, bmark, bmark, bmark, bmark)
 
 def _applyconvertbmarktopic(ui, repo, revs, old, bmark, tr):
     """apply bookmark convertion to topic