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

Re: Post commit script examples?

From: Yves Martin <ymartin59_at_free.fr>
Date: Fri, 20 Aug 2010 23:55:26 +0200

On Thu, 2010-08-19 at 11:24 -0600, Greg Alexander wrote:
> Hi Csaba,
> Thanks for the response. Yes, I am beginning to have a good feel for
> what Subversion was designed for, but I would still like to implement
> something. I saw the page in the book you reference, but I cannot find any
> examples on how to really implement. Any pointers anyone can provide would
> be great!

Really Allan has described the right way to do it:

- As a first step, create a script to do a checkout,
  add "svn:needs-lock" property on files you want
  and do a commit. So it should be OK for existing content.

For file additions after that point:

- Distribute auto-props "config" file with "svn:needs-lock"
  property for binary files that cannot be merged as source text
  As far as I know, that file is the same for all client/platform.
  On Linux (and probably MacOS X), command line svn and other clients
  read ~/.subversion/config
  On Windows, command line svn and TortoiseSVN read
  Application Data\Subversion\config

- Implement a pre-commit hook to reject commit submitting file without
  "svn:needs-lock" property when it is required
  The pre-commit hook can even display an URL with documentation and
  "config" file to install so that property is properly set at addition.

By the way, if work on files is not "segmented" enough (by team, by time
slice, by modules - think at splitting content in multiple smaller
files) locking will not help;
Developers cannot afford to wait for lock releases and will find the
work-around: branching
Then they may tell you to merge their work !

My opinion, there is only one response: education and proper
organization.

Regards
Yves Martin
Received on 2010-08-20 23:56:10 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.