From 94299f0b2ec2ca85288933c7c304a55443c7e3fa Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Fri, 6 Dec 2013 12:26:59 +0100 Subject: [PATCH 1/2] Disable localized mercurial output when checking "hg prompt abort" output, so that grep will find what it expect. --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 9430fa3..5c19c59 100644 --- a/index.html +++ b/index.html @@ -340,7 +340,7 @@ # /color-list # :hg - if [ -z "`echo $(hg prompt \"abort\" 2>&1) | grep abort`" ]; then + if [ -z "`echo $(LC_ALL=C hg prompt \"abort\" 2>&1) | grep abort`" ]; then echo "hg-prompt not installed. Suggest http://sjl.bitbucket.org/hg-prompt/installation/" fi From dd5f288a6650c886caaf9cfdcf24e880fd3fa0a4 Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Mon, 9 Dec 2013 21:37:49 +0100 Subject: [PATCH 2/2] Check .hg/branch existence before reading it. On fresh new repositories the file .hg/branch does not exist, so we need to check its existence first, and display default if it is absent. --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5c19c59..c465bd1 100644 --- a/index.html +++ b/index.html @@ -513,7 +513,7 @@ # :hg # If we are in mercurial ... if [ -n \"\$_hg_dir\" ]; then - hgBranch=\`cat \"\$_hg_dir/.hg/branch\"\` + hgBranch=\`[ -e \"\$_hg_dir/.hg/branch\" ] && cat \"\$_hg_dir/.hg/branch\" || echo \"default\"\` hgPrompt=\"s\" # :hg-modified