[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: svnversion feature

From: Bob Archer <Bob.Archer_at_amsi.com>
Date: Thu, 7 Jun 2012 13:28:51 -0400

> I am in the process of putting together make files for firmware builds and run
> into an issue that I didn't see addressed in any of the issues lists. One of the
> things I want to do is to tag the SVN revision that a binary was built from onto
> the file name (this was actually requested by manufacturing and I agree with
> their view point). The revision is easy enough to get from svnversion. The
> problem is, that when I run it  in my working directory, inevitably I get a
> mixed revision result, even if I have just committed (something like 3:26).
> While this may be informative to me as a developer, this is not something I
> can embed in a file name. At the same time Make has no ability to extract
> just the part after the colon.
>
> I see three solutions to this problem:
> 1. create another directory and do a clean checkout of the version I just
> committed. I tried this and it works well. Cumbersome though.
> 2. implement an external tool that runs svnversion and then disassembles
> the result to get the correct number for use in a file name. Ugly, too many
> tools needed already to get every day work done.
> 3. implement an option in svnversion that makes it to only spit out the
> highest revision number (no colon). Alternatively, the colon could be
> replaced by any character the user likes. That way something compatible
> with the file system can be chosen. I guess what I meant to say is, it would be
> nice to have control over the format in which svnversion reports the version.
> Thanks for taking the time to read and form an opinion about this.

4. Don't build against a mixed revision? Run svn up prior to doing your build, or as the first step.

BOb
Received on 2012-06-07 19:29:23 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.