zsh completion: disable defaults and verbose output when completing
authorBrodie Rao <me+hg@dackz.net>
Tue, 30 Jun 2009 17:58:17 -0400
changeset 8982 9c0cecb71350
parent 8981 080612b80c95
child 8983 0701044ad156
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.
contrib/zsh_completion
--- a/contrib/zsh_completion	Tue Jun 30 23:40:03 2009 +0200
+++ b/contrib/zsh_completion	Tue Jun 30 17:58:17 2009 -0400
@@ -364,7 +364,8 @@
   '--remotecmd[specify hg command to run on the remote side]:')
 
 _hg_cmd() {
-  _call_program hg hg "$_hg_cmd_globals[@]" "$@"
+  _call_program hg hg --config ui.verbose=0 --config defaults."$1"= \
+    "$_hg_cmd_globals[@]" "$@"
 }
 
 _hg_cmd_add() {