Fixed a bug in hgversion re: identification of tag sha1s, got changelog working in both git and hg

This commit is contained in:
2013-05-19 10:33:55 -04:00
parent 517916514b
commit 40ac4b926f
2 changed files with 6 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ fi
REBUILDING=0 REBUILDING=0
SHA1=$(git rev-parse HEAD) SHA1=$(git rev-parse HEAD)
TAG=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null) TAG=$(git describe --tags `git rev-list --tags --max-count=1 HEAD` 2>/dev/null)
BUILD=0 BUILD=0
CHANGELOG="$(git log --format="format:$LOGSPEC" ${BRANCH}@{0}..HEAD)" CHANGELOG="$(git log --format="format:$LOGSPEC" ${BRANCH}@{0}..HEAD)"
if [ "$TAG" == "" ]; then if [ "$TAG" == "" ]; then

View File

@@ -10,18 +10,18 @@ SHA1=$(hg identify -i | grep -Eo "[a-zA-Z0-9]+")
TAG=$(hg parents --template '{latesttag}') TAG=$(hg parents --template '{latesttag}')
TAGSHA=$(hg identify -r $TAG | cut -d ' ' -f 1) TAGSHA=$(hg identify -r $TAG | cut -d ' ' -f 1)
BUILD=0 BUILD=0
CHANGELOG="$(hg log -X .hgtags --style=changelog -r ${TAG}:${SHA1})" CHANGELOG="$(hg log --branch $BRANCH -X .hgtags --style=changelog -r ${TAG}:${SHA1})"
if [ "$TAG" == "" ]; then if [ "$TAG" == "" ]; then
BUILD=0 BUILD=0
REBUILDING=1 REBUILDING=1
MAJOR=$BRANCH MAJOR=$BRANCH
else else
MAJOR=$(echo $TAG | cut -d , -f 2) MAJOR=$(echo $TAG | cut -d \| -f 2)
BUILD=$(echo $TAG | cut -d , -f 3) BUILD=$(echo $TAG | cut -d \| -f 3)
SHORTTAGSHA=${TAGSHA:0:12} SHORTTAGSHA=${TAGSHA:0:12}
hg log -r ${SHA1} | grep "Added tag build|${BRANCH}|${BUILD} for changeset ${SHORTTAGSHA}" >/dev/null hg log -r tip | grep "Added tag build|${BRANCH}|${BUILD} for changeset ${SHORTTAGSHA}" >/dev/null
if [ $? -ne 0 ] && [ "$TAGSHA" != "$SHA1" ]; then if [ $? -ne 0 ] && [ "$TAGSHA" != "$SHA1" ]; then
CHANGELOG="$(hg log -X .hgtags --style=changelog -r ${SHORTTAGSHA}:${SHA1})" CHANGELOG="$(hg log --branch $BRANCH -X .hgtags --style=changelog -r ${SHORTTAGSHA}:${SHA1})"
BUILD=$(expr $BUILD + 1) BUILD=$(expr $BUILD + 1)
REBUILDING=1 REBUILDING=1
else else