Mercurial > dotfiles
diff .zsh/50.vcs_functions.zsh @ 10:b4bfce76123f
Reorder these checks. With my home being in hg, it was winning over any other
checkouts. Now look for hg last.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Tue, 02 Dec 2008 19:53:38 -0600 |
parents | c30d68fbd368 |
children | c22ca1514f3b |
line wrap: on
line diff
--- a/.zsh/50.vcs_functions.zsh +++ b/.zsh/50.vcs_functions.zsh @@ -67,14 +67,7 @@ function update_source_trees() { } function vcs_current_branch() { - hg branch 2> /dev/null > /dev/null - if [ $? = 0 ] ; then - local br=`hg branch | head -c 10` - local rid=`hg parents | head -n 1 | awk '{print $2}' | head -c 7` - echo "$br $rid" - return 0 - fi - git branch 2> /dev/null > /dev/null + git branch 2> /dev/null > /dev/null if [ $? = 0 ] ; then git branch --verbose | grep '^*' | sed 's/* //;s/ /:/;s/ .*//;s/:/ /' return 0 @@ -99,6 +92,13 @@ function vcs_current_branch() { echo $br $rev return 0 fi + hg branch 2> /dev/null > /dev/null + if [ $? = 0 ] ; then + local br=`hg branch | head -c 10` + local rid=`hg parents | head -n 1 | awk '{print $2}' | head -c 7` + echo "$br $rid" + return 0 + fi return 1 }