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.
--- 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)