From 238e0de053dcf1c3f407a679f962c93d5aff2788 Mon Sep 17 00:00:00 2001 From: Pandu POLUAN Date: Thu, 12 Oct 2017 23:29:20 +0700 Subject: [PATCH] Fix Mercurial detection --- themes/ys-pep.zsh-theme | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/ys-pep.zsh-theme b/themes/ys-pep.zsh-theme index 6fa5e1350..3f3b56202 100644 --- a/themes/ys-pep.zsh-theme +++ b/themes/ys-pep.zsh-theme @@ -16,6 +16,7 @@ # * List current IP addresses # * GCE hook (for controlling Google Cloud) # * Virtualenv hook +# * Fix Mercurial detection # # Sep-Oct 2017 Pandu POLUAN @@ -36,8 +37,8 @@ ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN" # HG info local hg_info='$(ys_hg_prompt_info)' ys_hg_prompt_info() { - # make sure this is a hg dir - if [ -d '.hg' ]; then + # make sure this is a Mercurial project + if [ -d '.hg' ] || $(hg summary > /dev/null 2>&1) ; then echo -n "${YS_VCS_PROMPT_PREFIX1}hg${YS_VCS_PROMPT_PREFIX2}" echo -n $(hg branch 2>/dev/null) if [ -n "$(hg status 2>/dev/null)" ]; then