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

Re: Can you set properties on a file without having it checked out?

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-05-12 16:04:56 CEST

On May 11, 2005, at 10:48 PM, Scott Simpson wrote:

> Ben Collins-Sussman wrote:
>
>
>>
>> You can't change versioned data (either a file's text or
>> properties) except in a working copy. Plain and simple. In
>> other words, you cannot change file-text or properties using a
>> URL argument to some command. There's no such thing, and it's
>> deliberate.
>>
>
> OK. So it looks like I'll have to add the property for my Change
> Request (CR) number on the client side. I could write a Perl script
> to intercept all the command line arguments and have all the users
> use that. This would have the disadvantage that I'd have to parse
> the "svn" command for file names and such. Yuck. Also, I need to
> handle three clients:
>
> On Windows: TortoiseSVN and Eclipse (and maybe command line)
> On Linux: Command line and Eclipse
>
> How would I intercept all three?
>
> I was also thinking of grabbing my metadata from the log message
> entered but I can't do that if I frontend "svn" with a script
> because I don't see the log message until after the transaction has
> finished. Therefore, I'll have to ask for the CR number first, add
> the properties to all the files, and then commit the transaction in
> my Perl script.
>
> This is getting unwieldy. Is this something Subversion cannot do?
>
>

I'm not really understanding what you're trying to do.

I see two very simple options:

    * write a pre-commit hook that rejects a commit that doesn't have
the metadata you expect. This forces users to remember to add the
metadata themselves.

    * attached the metadata as an *unversioned* property on the
revision itself. The book doesn't talk about this, but you can
easily have a post-commit hook attach an extra unversioned property
to the revision after the fact.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu May 12 16:11:07 2005

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.