D4267: zsh_completion: update all options

av6 (Anton Shestakov) phabricator at mercurial-scm.org
Tue Aug 14 00:28:18 EDT 2018


av6 added inline comments.

INLINE COMMENTS

> spectral wrote in zsh_completion:644
> I assume the first section here makes continue and abort mutually exclusive?  I believe that revision arguments are also forbidden if either --continue or --abort are specified; I don't know if there's a way of representing that.

Just having `--rev -r` inside the parentheses should be enough, but I'm not sure if implementing every piece of exclusivity logic here makes sense (I'm also concerned about completions diverging from real behavior). But I've found this in zsh's _git:
`(- :)--abort[cancel revert or cherry-pick sequence]`
This form disables completion of any other arguments, and I think it's future-proof enough to do this for `--abort` here. I'll do a follow-up to touch just exclusivity when this series lands.

> spectral wrote in zsh_completion:828
> Does the order of the first section matter?  Should the three of them be identical?

I don't think it matters. All options that the group mentions just disappear from completion when `-l`, `-m` or `-u` is present.

> spectral wrote in zsh_completion:1198
> Does this indicate that `hg rebase <hash> -d <dest>` should work (without a `-r`, `-s`, or `-b`?)  I don't think that's correct..

You mean giving revisions without `-r`? No, `*` means that `-r` can be specified multiple times (and each would require an argument). To see how it's done for a command that has "optional" `-r` see _hg_cmd_update or _hg_cmd_strip above ^

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4267

To: av6, #hg-reviewers, spectral
Cc: spectral, mercurial-devel


More information about the Mercurial-devel mailing list