From patchwork Tue Nov 26 19:54:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [13,of,15,V5] bash_completion: add global support for -B|--bookmark From: Sean Farley X-Patchwork-Id: 3167 Message-Id: <9978ec49c0eb4a9fbfd0.1385499292@laptop.local> To: mercurial-devel@selenic.com Date: Tue, 26 Nov 2013 14:54:52 -0500 # HG changeset patch # User Sean Farley # Date 1385497900 21600 # Tue Nov 26 14:31:40 2013 -0600 # Node ID 9978ec49c0eb4a9fbfd0ce6f973da184a0053037 # Parent 58efbd280c39addee05fe06175989da96823efd0 bash_completion: add global support for -B|--bookmark Previously, only -r|--rev was parsed globally which meant 'hg push -B ' would try to complete a path instead of a bookmark. diff --git a/contrib/bash_completion b/contrib/bash_completion --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -246,10 +246,17 @@ _hg_labels return 0 fi return 1 ;; + -B|--bookmark) + if [[ $canonical = 1 || status != "$cmd"* ]]; then + _hg_bookmarks + return 0 + fi + return 1 + ;; esac fi local aliascmd=$(_hg_cmd showconfig alias.$cmd | awk '{print $1}') [ -n "$aliascmd" ] && cmd=$aliascmd