comparison contrib/bash_completion @ 30199:ba22059602e3

bashcompletion: allow skipping completion for 'hg status' On systems with large repositories and slow disks, the calls to 'hg status' make autocomplete annoyingly slow. This fix makes it possible to avoid the slowdown.
author Mathias De Maré <mathias.de_mare@nokia.com>
date Mon, 26 Sep 2016 10:47:37 +0200
parents 63fad6235369
children fdbe4eafa9c2
comparison
equal deleted inserted replaced
30198:145482f505a5 30199:ba22059602e3
87 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur")) 87 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur"))
88 } 88 }
89 89
90 _hg_status() 90 _hg_status()
91 { 91 {
92 local files="$(_hg_cmd status -n$1 "glob:$cur**")" 92 if [ -z "$HGCOMPLETE_NOSTATUS" ]; then
93 local IFS=$'\n' 93 local files="$(_hg_cmd status -n$1 "glob:$cur**")"
94 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur")) 94 local IFS=$'\n'
95 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur"))
96 fi
95 } 97 }
96 98
97 _hg_branches() 99 _hg_branches()
98 { 100 {
99 local branches="$(_hg_cmd branches -q)" 101 local branches="$(_hg_cmd branches -q)"