Fix Mercurial detection

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

View file

@ -16,6 +16,7 @@
# * List current IP addresses # * List current IP addresses
# * GCE hook (for controlling Google Cloud) # * GCE hook (for controlling Google Cloud)
# * Virtualenv hook # * Virtualenv hook
# * Fix Mercurial detection
# #
# Sep-Oct 2017 Pandu POLUAN <pepoluan@gmail.com> # Sep-Oct 2017 Pandu POLUAN <pepoluan@gmail.com>
@ -36,8 +37,8 @@ ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN"
# HG info # HG info
local hg_info='$(ys_hg_prompt_info)' local hg_info='$(ys_hg_prompt_info)'
ys_hg_prompt_info() { ys_hg_prompt_info() {
# make sure this is a hg dir # make sure this is a Mercurial project
if [ -d '.hg' ]; then if [ -d '.hg' ] || $(hg summary > /dev/null 2>&1) ; then
echo -n "${YS_VCS_PROMPT_PREFIX1}hg${YS_VCS_PROMPT_PREFIX2}" echo -n "${YS_VCS_PROMPT_PREFIX1}hg${YS_VCS_PROMPT_PREFIX2}"
echo -n $(hg branch 2>/dev/null) echo -n $(hg branch 2>/dev/null)
if [ -n "$(hg status 2>/dev/null)" ]; then if [ -n "$(hg status 2>/dev/null)" ]; then