comparison .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
comparison
equal deleted inserted replaced
9:a6581f7a5b1a 10:b4bfce76123f
65 popd > /dev/null 65 popd > /dev/null
66 done 66 done
67 } 67 }
68 68
69 function vcs_current_branch() { 69 function vcs_current_branch() {
70 hg branch 2> /dev/null > /dev/null 70 git branch 2> /dev/null > /dev/null
71 if [ $? = 0 ] ; then
72 local br=`hg branch | head -c 10`
73 local rid=`hg parents | head -n 1 | awk '{print $2}' | head -c 7`
74 echo "$br $rid"
75 return 0
76 fi
77 git branch 2> /dev/null > /dev/null
78 if [ $? = 0 ] ; then 71 if [ $? = 0 ] ; then
79 git branch --verbose | grep '^*' | sed 's/* //;s/ /:/;s/ .*//;s/:/ /' 72 git branch --verbose | grep '^*' | sed 's/* //;s/ /:/;s/ .*//;s/:/ /'
80 return 0 73 return 0
81 fi 74 fi
82 # when wc-ng comes out, we'll probably do the following 75 # when wc-ng comes out, we'll probably do the following
95 } 88 }
96 } 89 }
97 }'` 90 }'`
98 local rev=`svn info | grep Revision | sed 's/.*: /r/'` 91 local rev=`svn info | grep Revision | sed 's/.*: /r/'`
99 echo $br $rev 92 echo $br $rev
93 return 0
94 fi
95 hg branch 2> /dev/null > /dev/null
96 if [ $? = 0 ] ; then
97 local br=`hg branch | head -c 10`
98 local rid=`hg parents | head -n 1 | awk '{print $2}' | head -c 7`
99 echo "$br $rid"
100 return 0 100 return 0
101 fi 101 fi
102 return 1 102 return 1
103 } 103 }
104 104