comparison .shell.d/50.vcs_functions.sh @ 462:fff281929b47

shrc: set HGPLAIN in prompt scaffolding
author Augie Fackler <raf@durin42.com>
date Thu, 02 Aug 2018 14:09:02 -0400
parents 980b3df541cd
children
comparison
equal deleted inserted replaced
461:607bc0754921 462:fff281929b47
123 }'` 123 }'`
124 local rev=`svn info | grep Revision | sed 's/.*: /r/'` 124 local rev=`svn info | grep Revision | sed 's/.*: /r/'`
125 echo $br $rev 125 echo $br $rev
126 return 0 126 return 0
127 fi 127 fi
128 hginfo=$(hg log --config extensions.blackbox='!' -r . -T'{if(activebookmark,"{activebookmark}","{branch}")} {shortest(node)}' 2>/dev/null) 128 hginfo=$(HGPLAIN=1 hg log --config extensions.blackbox='!' -r . -T'{if(activebookmark,"{activebookmark}","{branch}")} {shortest(node)}' 2>/dev/null)
129 if [ $? = 0 ] ; then 129 if [ $? = 0 ] ; then
130 echo "$hginfo" 130 echo "$hginfo"
131 return 0 131 return 0
132 fi 132 fi
133 return 1 133 return 1
134 } 134 }
135 135
136 function find_dvcs_root() { 136 function find_dvcs_root() {
137 local hgroot=`hg root 2> /dev/null` 137 local hgroot=`HGPLAIN=1 hg root 2> /dev/null`
138 local gitroot=$(git rev-parse --show-toplevel 2> /dev/null) 138 local gitroot=$(git rev-parse --show-toplevel 2> /dev/null)
139 local hglen=$(expr length $hgroot) 139 local hglen=$(expr length $hgroot)
140 local gitlen=$(expr length $gitroot) 140 local gitlen=$(expr length $gitroot)
141 if [ $hglen -ge $gitlen ] ; then 141 if [ $hglen -ge $gitlen ] ; then
142 if [ -n "$hgroot" ] ; then 142 if [ -n "$hgroot" ] ; then