[PATCH] bash/zsh completion: disable defaults and verbose output when completing

Brodie Rao dackze at gmail.com
Tue May 26 09:04:59 CDT 2009


On May 26, 2009, at 9:48 AM, Dirkjan Ochtman wrote:

> On Tue, May 26, 2009 at 3:43 PM, Brodie Rao <dackze at gmail.com> wrote:
>> # HG changeset patch
>> # User Brodie Rao <me+hg at dackz.net>
>> # Date 1243344105 14400
>> # Node ID 59dc4ad008d904d51ecdc78e1b8ef31ba2b7d8c6
>> # Parent  13613221caf147c959cb4c5761e41029d9789cc6
>> bash/zsh completion: disable defaults and verbose output when  
>> completing
>>
>> If ui.verbose is set to True in hgrc, commands used to provide  
>> completions
>> would yield bad results. For example, qpush completion would  
>> include the
>> patch numbers and statuses as returned by qunapplied -v, instead of  
>> just
>> the patch names.
>>
>> Defaults are also disabled when completing to prevent similar  
>> issues when
>> an option is set that changes a command's output.
>
> Matt has been talking about introducing an option to disable defaults
> (and/or deprecating defaults altogether). Wouldn't it make more sense
> to work in that direction?

Well, I wanted to have the changes work with previous versions of hg,  
but an option to disable defaults would be nice.

I looked at an earlier thread about adding a -D option to disable  
defaults, but I think that would be a little cumbersome for scripts  
trying to support versions of hg with and without the option. Maybe an  
environment variable would work better?

Also, would it make sense to roll ui.verbose=0 into that option?

Incidentally, I just noticed there's also a tcsh completion script.


More information about the Mercurial-devel mailing list