Make bash_completion more robust for e.g. broken hgrc or old hg installations.
authorThomas Arendsen Hein <thomas@intevation.de>
Sun, 12 Mar 2006 12:29:03 +0100
changeset 1888 283d2ab1e020
parent 1887 913397c27cd8
child 1889 468730910353
Make bash_completion more robust for e.g. broken hgrc or old hg installations.
contrib/bash_completion
--- a/contrib/bash_completion	Sun Mar 12 11:32:03 2006 +0100
+++ b/contrib/bash_completion	Sun Mar 12 12:29:03 2006 +0100
@@ -15,7 +15,8 @@
 
 _hg_commands()
 {
-    local commands="$("$hg" debugcomplete "$cur")"
+    local commands
+    commands="$("$hg" debugcomplete "$cur" 2>/dev/null)" || commands=""
     COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$commands' -- "$cur"))
 }