diff --git a/contrib/bash_completion b/contrib/bash_completion --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -56,7 +56,7 @@ shopt -s extglob _hg_paths() { - local paths="$(hg paths | sed -e 's/ = .*$//')" + local paths="$(hg paths 2> /dev/null | sed -e 's/ = .*$//')" COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W '$paths' -- "$cur" )) } @@ -70,13 +70,14 @@ shopt -s extglob _hg_status() { - local files="$( hg status -n$1 . )" + local files="$( hg status -n$1 . 2> /dev/null)" COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W '$files' -- "$cur" )) } _hg_tags() { - local tags="$(hg tags | sed -e 's/[0-9]*:[a-f0-9]\{40\}$//; s/ *$//')" + local tags="$(hg tags 2> /dev/null | + sed -e 's/[0-9]*:[a-f0-9]\{40\}$//; s/ *$//')" COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W '$tags' -- "$cur") ) } @@ -145,7 +146,7 @@ shopt -s extglob fi # canonicalize command name - cmd=$(hg -q help "$cmd" | sed -e 's/^hg //; s/ .*//; 1q') + cmd=$(hg -q help "$cmd" 2> /dev/null | sed -e 's/^hg //; s/ .*//; 1q') if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" = --rev ]; then _hg_tags