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

Re: Patching file before commit

From: John Peacock <jpeacock_at_rowman.com>
Date: 2003-06-29 13:22:54 CEST

Helge Jung wrote:
> In my project I've a file called version.txt in which there's only the
> version number of my project (so the program knows it's revision number
> by reading this file). All what I want is that when someone commits
> something this file is updated with the new revision number. In the
> hooks there was one making it possible to change files but a) there was
> also a warning not to do so and b) the version.txt is never
> touched/changed by a user/developer - it should only be changed by the
> system.

I've been thinking about something like this myself, and I believe I have an
idea which may work. The key is to make "version.txt" a plain file (i.e. not
versioned in the repository), and just have it updated/created by the hook
system for every commit. In other words, use post_commit rather than
pre_commit. I'd have to assume that your repository and web server wc are
located on the same machine (for ease of scripting) or else you have to use ssh
or something to create the file on a remote filesystem.

The only difficulty here is that you must create some other method of generating
this file when checking out a new wc, but that is trivial once you have the
above script.



John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jun 29 13:24:16 2003

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

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