Created
January 18, 2012 19:35
-
-
Save rsebbe/1635083 to your computer and use it in GitHub Desktop.
Finds the changeset corresponding to the passed build version (CFBundleVersion)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bn=(`echo $1 | tr '.' ' '`) | |
revn=${bn[0]} | |
hsh=${bn[1]} | |
# convert decimal hash to hexadecimal | |
hsh=`printf '%3.3x' $hsh` | |
# check all the hashes that start with the prefix | |
for rev in `hg log --template "{node}\n" | grep ^$hsh` | |
do | |
#echo $rev | |
nrev=`hg log -r "0::$rev" --template "{node}\n" | wc -l` | |
if [ "$nrev" -eq "$revn" ] | |
then | |
nrev=`hg log -r $rev --template "{rev}"` | |
echo "Revision found for build number $1: $nrev" | |
exit 0 | |
fi | |
done | |
echo "Revision for build number $1 not found" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment