D5495: revset: add "branch" positional arguments to the merge revset
Yuya Nishihara
yuya at tcha.org
Mon Jan 7 09:15:47 EST 2019
> + at predicate('merge(*withbranch)', safe=True)
> def merge(repo, subset, x):
> - """Changeset is a merge changeset.
> + """Changeset is a merge changeset
> +
> + All merge revisions are returned by default. If one or more "withbranch"
> + names are provided only merges with those branches (i.e. whose
> + second parent belongs to one of those branches) will be returned.
I understand this will be useful in a certain branch strategy, but the
proposed syntax is hardly extensible. Maybe it can be a non-wildcard argument
of `stringmatcher` type so we can at least add another option later.
Any thoughts? Do anyone love this feature?
If we had a syntax to filter revisions by sub expression, this and the
samebranch option could be expressed as follows:
```
merge() & filter($a, p2($a) & branch("..."))
merge() & filter($a, samebranch(parents($a)))
where filter(argname, boolean-expr)
```
This is much more expressive (or verbose) and can support other types of
branches, but is hard to implement.
More information about the Mercurial-devel
mailing list