zshrc.d/20-prompt.zrc
changeset 18 7095298e6f7d
parent 15 5f43e2cd8ebe
child 24 a26580f0890a
--- a/zshrc.d/20-prompt.zrc	Mon Jul 16 21:55:15 2012 +0200
+++ b/zshrc.d/20-prompt.zrc	Tue Jul 17 21:45:07 2012 +0200
@@ -120,7 +120,8 @@
     # 2e ligne
     pline+=( "[%B%n%b] " )              # Nom d'utilisateur
     pline+=( "$red%m$reset" )           # Nom de machine
-    pline+=( "$(__hg_prompt_info)" )    # Informations de dépôt Mercurial
+    [[ -z $_PROMPT__NO_HG_PROMPT ]] &&
+      pline+=( "$(__hg_prompt_info)" )  # Informations de dépôt Mercurial
     pline+=( "$(__git_prompt_info)" )   # Informations de dépôt git
     pline+=( "%# " )                    # Invite de commande
     lines+=( ${(j::)pline} )
@@ -184,6 +185,13 @@
 }
 function prompt_set_dev-mikael {
     __prompt_unset_dev-vcsinfo
+    unset _PROMPT__NO_HG_PROMPT
+    # Let's check we have the hg-prompt extension
+    hg showconfig extensions 2> /dev/null | grep -q "^extensions.prompt=" || {
+        print "You need the hg-prompt extension from Steve Losh." >&2
+        print "Check http://bitbucket.org/sjl/hg-prompt/" >&2
+        _PROMPT__NO_HG_PROMPT=1
+    }
     export _PROMPT_DEFINED="dev-mikael"
 }