destination: honor the sourceset argument of _destmerge
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 15 Aug 2016 00:19:44 +0200
changeset 1984 2a07df823588
parent 1983 4864ddc4c6d9
child 1985 03d6b685c16a
destination: honor the sourceset argument of _destmerge Mercurial gained a "sourceset" argument to compute the merge destination of any changeset (the one in the 'sourceset'). This now works for the version in topic too. The support is quite basic (because we pick only one changeset from the sourceset) but that's a start.
hgext3rd/topic/destination.py
--- a/hgext3rd/topic/destination.py	Mon Aug 15 05:25:53 2016 +0200
+++ b/hgext3rd/topic/destination.py	Mon Aug 15 00:19:44 2016 +0200
@@ -13,7 +13,12 @@
 def _destmergebranch(orig, repo, action='merge', sourceset=None,
                      onheadcheck=True, destspace=None):
     # XXX: take destspace into account
-    p1 = repo['.']
+    if sourceset is None:
+       p1 = repo['.']
+    else:
+        # XXX: using only the max here is flacky. That code should eventually
+        # be updated to take care of the whole sourceset.
+       p1 =  repo[max(sourceset)]
     top = p1.topic()
     if top:
         revs = repo.revs('topic(%s) - obsolete()', top)