# HG changeset patch # User Jeff Hammel # Date 1375682898 25200 # Node ID 41c3ea0a35136fa8fffbb5061d45d0f6cc36ef0a # Parent 337984b6af92ab965f8b442be3f0e87b79435a2d make hg safer, again diff -r 337984b6af92 -r 41c3ea0a3513 .bash_overrides --- 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 }