# HG changeset patch
# User Mathias De Maré <mathias.de_m...@nokia.com>
# Date 1474879657 -7200
#      Mon Sep 26 10:47:37 2016 +0200
# Node ID b1a58a479b5af23c7224b58413477daa007728e0
# Parent  1779dde4c9ef97cb242f8d501655f236f66e5439
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.

diff --git a/contrib/bash_completion b/contrib/bash_completion
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -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()
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to