D5495: revset: add "branch" positional arguments to the merge revset

Yuya Nishihara yuya at tcha.org
Mon Jan 14 08:28:51 EST 2019


>   What about making the argument a revset instead of a branch name. You can get the same result `merge(branch("foo")` but have a more expressive result `merge(only(4.8, 4.7))` ?

That's basically a simpler form of my `filter()` proposal.

The problem of `merge(branch("foo"))` is that it's ambiguous which revision
the expression will be tested against. It could be expressed as
`merge(p2=branch("foo"))` to disambiguate, but this syntax isn't generic
enough to express the `samebranch=True` constraint. So if we want a truly
expressive syntax, we'll need something like a lambda function.

```
filtereach(merge(), p2(_) & branch("foo"))
filtereach(merge(), samebranch(parents(_))
```

I agreed with Angel in that `merge(withbranch=name)` would be useful enough
to have a dedicated syntax, but I'm open to other ideas like
`merge(p1=expr, p2=expr)`.


More information about the Mercurial-devel mailing list