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

Re: Beautify code thru a hook

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2003-05-09 15:40:34 CEST

"Jean-Luc Wasmer" <jl.subversion@wasmer.ca> writes:

> How can I filter committed files thru a code beautifier (like astyle)?

I'm going to pretend for a moment that this idea doesn't make me
cringe. :-)

In theory, you'd write a pre-commit hook script which examines the
pending commit transaction in the repository, and changes it. You'd
probably have to use the svn_fs.h API to directly tweak the
transaction, either via C or Python.

But in practice, the svn client can't deal with this sort of thing.
If the pre-commit hook changes file contents, the client currently has
no way of learning about this. The server simply says "commit
complete", and the client then goes on assuming that the files
committed from the original working-copy directory are identical to
the ones in the repository. This will cause detrimental things; 'svn
up' and other functions will start to produce nasty checksum errors,
and the original working-copy directory will slowly bitrot.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 9 15:41:36 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.