--- a/.bash_prompt Thu Apr 03 01:10:52 2014 +0900
+++ b/.bash_prompt Fri Aug 22 17:06:56 2014 +0900
if [[ "$HG_TRACKED" ]] ; then
- local HG_INFO=" $(hg prompt $PROMPT_TEMPLATE)"
+ local SUM=$(LC_ALL=C hg sum)
+ local PARENTS=($(echo "$SUM" | grep -Po '(?<=parent: ).*(?=:)'))
+ local BRANCH=$(echo "$SUM" | grep -Po '(?<=branch: ).*$')
+ local COMMIT=$(echo "$SUM" | grep -Po '(?<=commit: ).*$')
+ local UPDATE=$(echo "$SUM" | grep -Po '(?<=update: ).*$')
+ local REV=${PARENTS[0]}
+ local MERGEREV=${PARENTS[1]}
+ BRANCH=${BRANCH/default/}
+ [ -z "$MERGEREV" ] || MERGEREV="+$MERGEREV"
+ *added*|*modified*|*deleted*)
+ local HG_INFO=" ${P}${BRANCH}☿${REV}${R}${UPDATE}${G}${MERGEREV}${R}${COMMIT}${RESET}"
if [[ "$GIT_TRACKED" ]] ; then
local GIT_STATUS=$(git status 2>/dev/null)