Integrating revision number with .NET assembly

Giorgos Keramidas keramida at ceid.upatras.gr
Fri Aug 1 04:23:26 CDT 2008


On Fri, 01 Aug 2008 12:14:54 +0300, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
> On Fri, 1 Aug 2008 01:48:55 -0700 (PDT), graealex <Alex at GRAEF.cc> wrote:
>> Hello,
>>
>> I'm looking for a way to get the repositories revision number as the
>> version number of a .NET assembly. Is there any way?
>
> "hg identify"?

This may be slightly less useful than I intented it to be.  I recently
patched my copy of FreeBSD's kernel version script with something
similar to the current svn version but for hg:

    hgroot=`cd ${SRCDIR} && ${hgexe} root`
    if [ -n "${hgroot}" ] && \
           ( cd "${SRCDIR}" && hg manifest ) | fgrep sys/sys/param.h | \
           sed -e "s@^@${hgroot}/@" | xargs expand | \
           grep -q '#define[ ]*__FreeBSD_version' ; then
               hg=" hg@`hg identify --id | expand | sed -e 's/ .*//'`"
    fi

Then in the version string, I just included "${hg}".  When defined, it
should include the changeset id of the node I'm building :)



More information about the Mercurial mailing list