diff mercurial/revset.py @ 28139:5476a7a039c0

destutil: allow to specify an explicit source for the merge We can now specify from where the merge is performed. The experimental revset is updated to take revisions as argument, allowing to test the feature. This will become very useful for pick the 'rebase' default destination. For this reason, we also exclude all descendants from the rebased set from the candidate destinations. This descendants exclusion was not necessary for merge as default destination would not be picked from anything else than a head. I'm not super excited with the current error messages, but I would prefer to delay an overall messages rework once 'hg rebase' is done getting a default destination aligned with 'hg merge'.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 08 Feb 2016 19:32:29 +0100
parents a036e1ae1fbe
children d2ac8b57a75d
line wrap: on
line diff
--- a/mercurial/revset.py	Mon Feb 08 18:12:06 2016 +0100
+++ b/mercurial/revset.py	Mon Feb 08 19:32:29 2016 +0100
@@ -541,8 +541,10 @@
 @predicate('_destmerge')
 def _destmerge(repo, subset, x):
     # experimental revset for merge destination
-    getargs(x, 0, 0, _("_mergedefaultdest takes no arguments"))
-    return subset & baseset([destutil.destmerge(repo)])
+    sourceset = None
+    if x is not None:
+        sourceset = getset(repo, fullreposet(repo), x)
+    return subset & baseset([destutil.destmerge(repo, sourceset=sourceset)])
 
 @predicate('adds(pattern)', safe=True)
 def adds(repo, subset, x):