comparison 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
comparison
equal deleted inserted replaced
28138:5ad2017454ee 28139:5476a7a039c0
539 return subset & baseset([destutil.destupdate(repo, **args)[0]]) 539 return subset & baseset([destutil.destupdate(repo, **args)[0]])
540 540
541 @predicate('_destmerge') 541 @predicate('_destmerge')
542 def _destmerge(repo, subset, x): 542 def _destmerge(repo, subset, x):
543 # experimental revset for merge destination 543 # experimental revset for merge destination
544 getargs(x, 0, 0, _("_mergedefaultdest takes no arguments")) 544 sourceset = None
545 return subset & baseset([destutil.destmerge(repo)]) 545 if x is not None:
546 sourceset = getset(repo, fullreposet(repo), x)
547 return subset & baseset([destutil.destmerge(repo, sourceset=sourceset)])
546 548
547 @predicate('adds(pattern)', safe=True) 549 @predicate('adds(pattern)', safe=True)
548 def adds(repo, subset, x): 550 def adds(repo, subset, x):
549 """Changesets that add a file matching pattern. 551 """Changesets that add a file matching pattern.
550 552