Fix the generateHgRevision script for copies of the source code that aren't checkouts of hg repositories.
authorPeter Hosey <hg@boredzo.org>
Sat Oct 17 22:37:15 2009 -0700 (2009-10-17)
changeset 4535f5c4f91c5261
parent 4534 81dc4c264dc1
child 4536 850cb5da7afd
Fix the generateHgRevision script for copies of the source code that aren't checkouts of hg repositories.
generateHgRevision.sh
     1.1 --- a/generateHgRevision.sh	Thu Oct 15 21:33:55 2009 -0700
     1.2 +++ b/generateHgRevision.sh	Sat Oct 17 22:37:15 2009 -0700
     1.3 @@ -14,6 +14,14 @@
     1.4  #nonetheless, we should handle it sanely. We do this by only showing the
     1.5  #first parent.
     1.6  REVISION=`hg parent --template="{rev}\n" | head -n1`
     1.7 +if [[ "x$REVISION" = "x" ]]; then
     1.8 +	#This is not an hg repository. It's probably an archive. Try to determine the archived revision.
     1.9 +	REVISION=`/usr/bin/sed -E -n '/^node:/{ s/node: //; s/^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]).*/\1/; p; q; }' < "${SRCROOT}/.hg_archival.txt"`
    1.10 +	if [[ "x$REVISION" = "x" ]]; then
    1.11 +		#Not an archive, either. Weird.
    1.12 +		REVISION=0
    1.13 +	fi
    1.14 +fi
    1.15  echo "*** Building Growl Revision: $REVISION"
    1.16  mkdir -p "`dirname "$HEADERPATH"`"
    1.17