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

Re: Edit the file commited and save the current revision

From: Simon Large <simon.tortoisesvn_at_googlemail.com>
Date: Fri, 15 Jan 2010 22:39:38 +0000

2010/1/15 Rafael M. Heise <rmheise_at_gmail.com>:
> Hi guys.
>
> This is my situation. I have a repository and I would like to save the
> current revision on my files, because I would like to know what
> revision my customer is running.
>
> How could I edit my files to save the current revision on?
>
> I think I must use post-commit hook. But I'm not sure about.
>
> And, Is there some script already done to do something like that?

You need to use SubWCRev to extract the version of your working copy.
You give it a template file which has markers in like "$WCREV$" and it
generates a copy but with those markers replaced with real data.

For C programs you can create a template header, Revision.in

#define SVN_REVISION $WCREV$
#define SVN_REV_STRING "r$WCREV$"

I have a batch file which runs SubWCRev like this:

@echo off
"C:\Program Files\TortoiseSVN\bin\SubWCRev" . Revision.in Revision.h

I can then rebuild and get the version information included.

If your dev environment includes a pre-build step you can call the
program from there. Alternatively you could use a TSVN client side
post-commit hook and post-update hook to call it.

Simon

-- 
:       ___
:  oo  // \\      "De Chelonian Mobile"
: (_,\/ \_/ \     TortoiseSVN
:   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
:   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2437571
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2010-01-15 23:39:43 CET

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.