Mercurial > hg > config
changeset 414:41c3ea0a3513
make hg safer, again
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sun, 04 Aug 2013 23:08:18 -0700 |
parents | 337984b6af92 |
children | daa85a7909d8 |
files | .bash_overrides |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/.bash_overrides Sun Aug 04 23:03:06 2013 -0700 +++ b/.bash_overrides Sun Aug 04 23:08:18 2013 -0700 @@ -97,6 +97,7 @@ `which find` -L "$DIR" -not -path '*.svn*' "$@" } +# make hg safer since $HOME is versioned function hg { if [[ "$(command hg root)" == "${HOME}" ]] then @@ -105,11 +106,12 @@ command hg st -q return fi - if [[ "$*" == res* ]] || [[ "$*" == pu* ]] + if [[ "$*" == res* ]] || [[ "$*" == pur* ]] then echo "Aborting \'hg $*\'; hg root is ${HOME}!" return 1 fi + command hg "$@" fi }