--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.bash_prompt Sun Jan 02 17:08:25 2011 +0800
+function prompt_command {
+ local RESET="\[\e[0m\]"
+ local PROMPT_TEMPLATE="$P{branch|quiet}@{rev}{$R{update}}{$G+{rev|merge}}$R{status|modified}"
+ if [[ ${EUID} == 0 ]] ; then
+ # getting hg info is disabled for root
+ # testing if current dir is a part of hg repo
+ [[ -d $TEST_DIR/.hg ]] && local TRACKED=1 && break
+ [[ $TEST_DIR == '/' ]] && break
+ TEST_DIR=$(dirname "$TEST_DIR")
+ if [[ $TRACKED ]] ; then
+ local MISC_INFO=" $(hg prompt $PROMPT_TEMPLATE)"
+ if [[ "$RETURN_CODE" != 0 ]] ; then
+ local PROMPT_PREFIX="$R${RETURN_CODE} "
+${BOLD}[$G\t ${RESET}\u@\h \
+${PROMPT_PREFIX}${RESET}\W${MISC_INFO}${RESET}${BOLD}]\
+${PROMPT_COLOR}\\\$${RESET} "
+export PROMPT_COMMAND=prompt_command
--- a/.bashrc Sat Jul 03 18:44:45 2010 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
-alias ls="ls --color=auto"
-function prompt_command {
- local RESET="\[\e[0m\]"
- local PROMPT_TEMPLATE="$P{branch|quiet}@{rev}{$R{update}}{$G+{rev|merge}}$R{status|modified}"
- if [[ ${EUID} == 0 ]] ; then
- if [[ "$RETURN_CODE" != 0 ]] ; then
- local PROMPT_PREFIX="$R${RETURN_CODE} "
- [[ -d $TEST_DIR/.hg ]] && local TRACKED=1 && break
- [[ $TEST_DIR == '/' ]] && break
- TEST_DIR=$(dirname "$TEST_DIR")
- if [[ $TRACKED ]] ; then
- local MISC_INFO=" $(hg prompt $PROMPT_TEMPLATE)"
-${BOLD}[$G\t ${RESET}\u@\h \
-${PROMPT_PREFIX}${RESET}\W${MISC_INFO}${RESET}${BOLD}]\
-${PROMPT_COLOR}\\\$${RESET} "
-export PROMPT_COMMAND=prompt_command