forked from mirrors/jj
2d0b6560e8
Commands like `new`, `duplicate`, and `abandon` can take multiple revset arguments which results in their collective union. They take the revisions directly as arguments. But for consistency with many other commands, they can also take the `-r` argument, which is a no-op. However, due to the flag being specified as a `bool`, the `-r` option can only be specified once, so e.g. `abandon -r x -r y` often fails. I normally use `-r` for consistency and muscle memory, so this bites me often. Instead, use `clap::ArgAction::Count` in order to allow `-r` to be specified multiple times. It remains unused, of course. With this change, all the following invocations are equivalent. Before this change, the second example would fail due to giving `-r` multiple times. jj abandon x y jj abandon -r x -r y jj abandon -r 'x | y' Note: `jj new` already supported this exact case actually, but it used an awkward trick where it used `.overrides_with()` in order to override *itself* so it could be specified multiple times. I believe this is a bit clearer. Signed-off-by: Austin Seipp <aseipp@pobox.com> Change-Id: Ib36cf81d46dae4f698f06d0a32e8fd3120bfb4a4 |
||
---|---|---|
.. | ||
examples | ||
src | ||
testing | ||
tests | ||
build.rs | ||
Cargo.toml | ||
LICENSE |