From 128e426f01b8ae6f03f33ed5b49e1054e7f64eb2 Mon Sep 17 00:00:00 2001 From: grimborg Date: Thu, 15 May 2014 10:52:00 +0200 Subject: [PATCH] Auto-open virtualenv on mercurial like on git --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index f58bda1ad..166f6fc4f 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -11,6 +11,9 @@ if (( $+commands[$virtualenvwrapper] )); then WORKON_CWD=1 # Check if this is a Git repo PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null` + if (( $? != 0 )); then + PROJECT_ROOT=`hg prompt '{root}' 2>/dev/null` + fi if (( $? != 0 )); then PROJECT_ROOT="." fi