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

Re: Re: Force commit of unchanged file

From: Slarge <slarge_at_slarge.plus.com>
Date: 2006-06-20 17:55:27 CEST
('binary' encoding is not supported, stored as-is) On Tue Jun 20 11:13 , Phil Cairns <phil.cairns@gmail.com> sent:

>Peter McNab wrote:
>> Phil Cairns wrote:
>>> Hi,
>>> I'm developing using VC2003, and I used to use a program that would
>>> parse my resource file and increment the last value in my version
>>> resource during a release build. This is kind of a nuisance, since
>>> updating the resource file means that the project is going to rebuild,
>>> which means that the version number is going to increment, and on it
>>> goes. Sort of. Because sometimes it builds fast enough, and the file
>>> system timestamps aren't high-res.
>> Why tamper with auto generated files at all?. You can insert the build
>> number into one of your source files by running SubWCRev.exe that comes
>> with Tortoise and avoid "touching" the .res file altogether.
>I should have said "my resource script file". However, I thought this line
> > IDS_SVNREVISION "$Rev: 1948 $"
>was a bit of giveaway.
>I liked the idea of SubWCRev.exe, and tried it. I created a
>"svnrevision-template.h" file, with this as the contents:
>const char* SVNREVISION = "(Rev. $WCREV$)";
>In my prebuild event, I included this line (broken for readability):
>"C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" \
> "$(InputDir)." \
> "$(InputDir)..\common\svnrevision-template.h" \
> "$(InputDir)..\common\svnrevision.h" -f
>Then in my about box cpp file, I #included svnrevision.h, and displayed
>the string. This all works, but it has the same problems as my
>buildno.exe. That is, the file is going to be updated every time I do a
>build. More to the point, the file's timestamp is going to be updated,
>and the IDE is going to want to rebuild all files dependent on this one.

No, not after the first time. SubWCRev creates the file as a temp file and
compares it to the existing one (if present). If they are identical (should be
the case if there are no local changes), the temp file is silently discarded so
as not to change timestamps unnecessarily.

>I'm looking for this file to be updated whenever I do a commit for that
>directory. I guess I'm looking for a post-commit event. Is there a way
>to hook into that? I'm quite prepared to write code if necessary, but
>don't want to reproduce it if someone has already done it.

Client-side hooks are in our issue tracker, but not high priority at the moment.
But you should just be able to add it as a pre-build step anyway. The only gotcha
is that you have to remember to rebuild after a commit. I generally use the
$WCMODS keyword to add a suffix like "-dev" to the version string if there are
local uncommitted mods.


To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Tue Jun 20 17:42:29 2006

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

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