Auto-open virtualenv on mercurial like on git

This commit is contained in:
grimborg 2014-05-15 10:52:00 +02:00
commit 128e426f01

View file

@ -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