changeset 1984:2a07df823588

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 15 Aug 2016 00:19:44 +0200
parents 4864ddc4c6d9
children 03d6b685c16a
files hgext3rd/topic/destination.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)