diff .shell.d/50.vcs_functions.sh @ 368:354d05616d65

vcs_funcs: fix for when in no repo
author Augie Fackler <raf@durin42.com>
date Fri, 11 Sep 2015 13:57:02 -0400
parents 51aaf8bcd6ec
children 980b3df541cd
line wrap: on
line diff
--- a/.shell.d/50.vcs_functions.sh
+++ b/.shell.d/50.vcs_functions.sh
@@ -125,7 +125,7 @@ function vcs_current_branch() {
         echo $br $rev
         return 0
     fi
-    hginfo=$(hg log -r . -T'{if(activebookmark,"{activebookmark}","{branch}")} {shortest(node)}')
+    hginfo=$(hg log -r . -T'{if(activebookmark,"{activebookmark}","{branch}")} {shortest(node)}' 2>/dev/null)
     if [ $? = 0 ] ; then
         echo "$hginfo"
         return 0