Recording source information in a build
jesse.glick at sun.com
Tue Apr 29 11:25:37 PDT 2008
Kelly O'Hair wrote:
>> I would expect 'java -version' to include the changeset ID, if it
>> were built from sources and was not a formal release.
> Ah, if it was only one changeset ID that would be great, but we have
> many repositories. I'm thinking a 'java -sourceversion' option maybe?
Well, 'java -version' already consumes three lines of text. I don't see
a real problem with adding one line for unofficial builds from source:
Hg 613dea62d e84e9018b 24706b95d bafed478d 27d8f4286 2249879c6 eb4c60ad2
Compact at only 72 columns of text, good for email, and without much
risk of ambiguity (capable of distinguishing 68 billion changesets).
ids=Hg; for m in . *; do if [ -d $m/.hg ]; then id=`hg -R $m id | cut
-c1-9`; ids="$ids $id"; fi; done; echo $ids
Could be modified to retain tags (probably excepting 'tip', 'qtip', and
'qbase') and/or '+' for modified sources if desired.
You could also consider including the output of 'hg qapp' to clearly
mark builds from sources using uncommitted MQ patches. ('hg id' in its
full form will show 'qtip' and a patch name, though not the full applied
More information about the build-dev