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

RE: Need possibilities to set Subversion property for keyword expansion

From: Ramachandran, Vishwanath(IE10) <Vishwanath.Ramachandran_at_Honeywell.com>
Date: Wed, 13 May 2009 13:06:41 +0530

Hi Ryan

Pls confirm my assumption:

1 .Keyword expansion will be done on client side. (Replacing in
"committed" document the "placeholder" with the keywords).
2. The client will do this action only if the svn property is set
(stored in repository). If the svn-property is not set client is not
doing any keyword expansion.
3. This property can be created in different ways:
a.) manually (e.g. on client subversion -> property dialog -> new
property -> snv: keyword expansion)
b.) automated on client: -> if in autoprops the corresponding entries
are set the property will be set once the first commit happens.
c.) The way you proposed it -> on the server with a script which checks
if the property is not already set -> and if not set -> set the
property.

->a.) and b.) we are doing already and we know that it works ->
disadvantage: For a.) -> manual work, for b.) -> all clients need to get
the autoprops set -> which is also manual work on each client -> error
prone.

-> desired would be solution c [:)]

Regards
R.R.Vishwanath
Desk: +91 80 26588360 Extn: 44211
Cell: +91 9632243577
========================================================================
========================================================================
========
-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2009a_at_ryandesign.com]
Sent: Friday, May 08, 2009 3:20 PM
To: Ramachandran, Vishwanath(IE10)
Cc: Campbell Allan; users_at_subversion.tigris.org
Subject: Re: Need possibilities to set Subversion property for keyword
expansion

On May 8, 2009, at 00:37, Ramachandran, Vishwanath(IE10) wrote:

> I need to know if it would be possible to make modifications on the
> subversion server side for the repository in a way that everytime a
> new
> item is added to the repository it will get added (automatically on
> server side) the property svn:needs-lock .
>
> I think that it is possible to locally set on the Tortoise client a
> special setting in the config file in the section "auto-props". The
> disadvantage with that is that each client has to do this on his
> machine
> seperately.
>
> First i need to have this information if this is possible to implement
> on the server (and if you could do this)-> Pls let me know. Also i
> need
> the information if there are any side effects or disadvantages of
> doing
> this on the server.
>
> Before really setting up the repository i have to confirm you that we
> really want to go this way

Yes, you can do it on the server, but it is not recommended. You
cannot (well, with language bindings maybe you can, but in any case
you absolutely must not) change the incoming transaction. Therefore,
your only option is to immediately commit a second revision to fix a
preceding revision that does not have the correct properties set.
This is difficult because the server must maintain a working copy in
which to perform these changes, and there are race conditions to
think about, not to mention the fact that a developer's working copy
will be immediately outdated after committing, which the developer
would not ordinarily expect.

The better and recommended way is to do it on the client side in auto-
props, as you already found, and then install a pre-commit hook on
the server which rejects any commit which does not conform to your
requirements. Developers will realize after the second or third time
that maybe they should set up their auto-props.

> I know that Keyword expansion is a client-side operation, and your
> client only "knows" about changes which have occurred in the
> repository
> when you update your working copy to include those changes
>
> But What i want to get is just to get for each file the properties for
> keyword expansion set ->directly on the server -> same as the property
> snv:Need-lock has been set.

Keyword expansion does not happen on the server. It happens on the
client. This cannot be changed.

> We want just to add the property "snv:keyword URL Rev Author Date" for
> the file types *.doc, *.xls, *.mm, *.mpp, *. ppt. directly during
> commiting (same as it is done for snv:need-lock).

Do it as explained above. Use a combination of auto-props on the
client for convenience and a pre-commit hook on the server to
enforce. The property will be saved in the repository, and the
keyword expansion will be done by the client on checkout or update.

Note that the Subversion properties begin with "svn:" (for
"SubVersioN"), not "snv:".

> The description in the attached word file was just a "workaround"
> which
> we used today to reach that.

I did not find an attachment on your email. If you do attach
something, better not use Word format, as many here probably don't
have Word. Text files are best, or for more complex documents a PDF
would be ok.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2231298

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-05-13 09:38:04 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.