Fix Mercurial detection

This commit is contained in:
Pandu POLUAN 2017-10-12 23:29:20 +07:00
commit 88fbce4415

View file

@ -16,6 +16,7 @@
# * List current IP addresses
# * GCE hook (for controlling Google Cloud)
# * Virtualenv hook
# * Fix Mercurial detection
#
# Sep-Oct 2017 Pandu POLUAN <pepoluan@gmail.com>
@ -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