bashcompletion: allow skipping completion for 'hg status'
authorMathias De Maré <mathias.de_mare@nokia.com>
Mon, 26 Sep 2016 10:47:37 +0200
changeset 30199 ba22059602e3
parent 30198 145482f505a5
child 30200 a2804ddcf9ae
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.
contrib/bash_completion
--- a/contrib/bash_completion	Sun Aug 21 01:12:00 2016 +0200
+++ b/contrib/bash_completion	Mon Sep 26 10:47:37 2016 +0200
@@ -89,9 +89,11 @@
 
 _hg_status()
 {
-    local files="$(_hg_cmd status -n$1 "glob:$cur**")"
-    local IFS=$'\n'
-    COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur"))
+    if [ -z "$HGCOMPLETE_NOSTATUS" ]; then
+        local files="$(_hg_cmd status -n$1 "glob:$cur**")"
+        local IFS=$'\n'
+        COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur"))
+    fi
 }
 
 _hg_branches()