Mercurial > hg > config
diff .bash_overrides @ 414:41c3ea0a3513
make hg safer, again
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sun, 04 Aug 2013 23:08:18 -0700 |
parents | 337984b6af92 |
children | 32b202653753 |
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 }