bash_completion: add global support for -b|--branch
authorSean Farley <sean.michael.farley@gmail.com>
Tue, 26 Nov 2013 14:33:18 -0600
changeset 20135 e39bd4b7be78
parent 20134 bc9735855598
child 20136 1df77035c814
bash_completion: add global support for -b|--branch Previously, only -r|--rev was parsed globally which meant 'hg push -b <tab>' would try to complete a path instead of a branch.
contrib/bash_completion
--- a/contrib/bash_completion	Tue Nov 26 14:31:40 2013 -0600
+++ b/contrib/bash_completion	Tue Nov 26 14:33:18 2013 -0600
@@ -255,6 +255,13 @@
                 fi
                 return 1
             ;;
+            -b|--branch)
+                if [[ $canonical = 1 || status != "$cmd"* ]]; then
+                    _hg_branches
+                    return 0
+                fi
+                return 1
+            ;;
         esac
     fi