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

Re: Modifying file properties in pre-commit

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Sun, 14 Sep 2008 11:39:19 -0500

On Sep 14, 2008, at 9:09 AM, Lira Olavo wrote:

> Ryan Schmidt wrote:
>> On Sep 13, 2008, at 6:53 PM, Lira Olavo wrote:
>>> Thank you all for the answer also, pin the TAG is also my problem
>>> but I can't control all the clients for witch SVN Gui they are
>>> using,
>>> sometimes is subversive, others, subclipse, sventon, tortoise and
>>> ant
>>> svn... How can I impose the pin of a svn:externals during a TAG for
>>> all my clients then?
>> Write a pre-commit hook. The logic would be something like:
>> Check "svnlook dirs-changed" on the incoming transaction. If
>> something is being added in the tags directory, then check every
>> subdirectory of the thing being added for the presence of the
>> svn:externals property. If it exists, check to make sure the value
>> contains "-r N" where N is an integer. If it doesn't, print an error
>> to stderr explaining to the user that they need to use svncopy.pl and
>> exit with a nonzero value.
> As Purple Streak said, also my users are not in *nix and If I
> just send a message about using the Perl scrip it would not work :
> ( Most
> of them are not technical.

It would work if your error message directs them to the URL of a web
page where you explain exactly what they must do. :)

> My question is: If I freeze with the -r or with the PEG (@xxx as
> I'm 1.5.2) inside the TAG I don't think it would "break the checkout
> right? Is it safe to do it?

If the tag is made using repository URLs directly (which would be the
normal case for tagging), then there is no working copy to get
corrupted and it would be fine:

svn cp -r123 $REPO/trunk $REPO/tags/mytag -m "making mytag from trunk

However at the server side there's no way to determine whether the
action is being performed using repository URLs or via a working
copy. And if it is being done via a working copy, then the
information I have says that the working copy will blow up later when
it receives new diff data from the repository that cannot be applied.

IMHO, a revision control system is not a "set it and forget it" kind
of thing, and it's not transparent. Users need to understand what
they are doing with the system and pay attention to it. All of your
users should read the Subversion Book (svnbook.org), and even if they
use TortoiseSVN most of the time, all of your users should be
comfortable using the command line to interact with Subversion. These
should be made into job requirements.

To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-09-14 18:40:08 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.