(svn r14519) -Fix [FS#2376]: do not use the short hash form for getting a specific mercurial/git revision as those can collide quite easily causing reversion detection to fail (PhilSophus)

This commit is contained in:
rubidium 2008-10-22 22:07:43 +00:00
parent 02cbe47754
commit 428de2d302

View File

@ -82,8 +82,8 @@ elif [ -d "$ROOT_DIR/.git" ]; then
if [ -n "`git diff-index HEAD \"$SRC_DIR\"`" ]; then if [ -n "`git diff-index HEAD \"$SRC_DIR\"`" ]; then
MODIFIED="2" MODIFIED="2"
fi fi
HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null | cut -c1-8` HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`
REV="g$HASH" REV="g`echo $HASH | cut -c1-8`"
BRANCH=`git branch|grep '[*]' | sed 's~\* ~~;s~^master$~~'` BRANCH=`git branch|grep '[*]' | sed 's~\* ~~;s~^master$~~'`
REV_NR=`LC_ALL=C git log --pretty=format:%s "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s~.*(svn r\([0-9]*\)).*~\1~"` REV_NR=`LC_ALL=C git log --pretty=format:%s "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s~.*(svn r\([0-9]*\)).*~\1~"`
elif [ -d "$ROOT_DIR/.hg" ]; then elif [ -d "$ROOT_DIR/.hg" ]; then
@ -91,8 +91,8 @@ elif [ -d "$ROOT_DIR/.hg" ]; then
if [ -n "`hg status \"$SRC_DIR\" | grep -v '^?'`" ]; then if [ -n "`hg status \"$SRC_DIR\" | grep -v '^?'`" ]; then
MODIFIED="2" MODIFIED="2"
fi fi
HASH=`LC_ALL=C hg parents 2>/dev/null | head -n 1 | cut -d: -f3 | cut -c1-8` HASH=`LC_ALL=C hg parents 2>/dev/null | head -n 1 | cut -d: -f3`
REV="h$HASH" REV="h`echo $HASH | cut -c1-8`"
BRANCH=`hg branch | sed 's~^default$~~'` BRANCH=`hg branch | sed 's~^default$~~'`
REV_NR=`LC_ALL=C hg log -r $HASH:0 -k "svn" -l 1 --template "{desc}\n" "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s~.*(svn r\([0-9]*\)).*~\1~"` REV_NR=`LC_ALL=C hg log -r $HASH:0 -k "svn" -l 1 --template "{desc}\n" "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s~.*(svn r\([0-9]*\)).*~\1~"`
else else