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

Re: Adding properties

From: Simon Large <simon.tortoisesvn_at_gmail.com>
Date: Wed, 3 Nov 2010 15:05:41 +0000

On 3 November 2010 13:44, Robert Lankford
<robertlfilter-collabnet_at_yahoo.com> wrote:
> Sorry if I'm all over the map here.
> __Overview__
> I've come to the discovery that I need to add the "svn:mime-type" property
> to all of the PDF documents in all my repositories in order to get those
> documents treated as binary data when served from Apache.  From here
> (http://subversion.apache.org/faq.html#auto-props), I discover that there is
> no easy way to do this: "to set properties on all files already in the
> repository, you'll need to do it the hard way. All you can do is run svn
> propset on every file (in a working copy), and then svn commit.".
> So, I'm left with the task of looping over all the repositories, checking
> them out, looping over all the PDFs, and invoking "svn propset" from the
> command line.  Which isn't great, but whatever.  I guess I can do that.

Sounds like the best plan to me.

> __The Complication__
> The script itself is easy to write.  It's the idea of waiting for all of
> that to run.  And then adding a similar mechanism to the "post-commit"
> trigger to invoke that behavior whenever someone makes a change to the
> repository.  And, yes, I could try to educate folks on keeping up with these
> properties on their end, but I *know* it'll never work 100% of the time.

As Jean-Marc says, svn:auto-props is the way to go here. You can also
look at tsvn:auto-props which means you don't have to rely on everyone
setting up their own auto-props locally. Of course it only works when
you use the TSVN client.

> Then I tried something.  I tried adding a property to a file from the
> TortoiseSVN Repo-Browser.  This was a property on a file that I DID NOT have
> checked out locally to my computer.  It, of course, worked like a charm.
>  And, it worked quickly (meaning that it obviously did not check out the
> whole folder in the background).
> __The Question__
> How?  And, more to the point, how can I tap into that and script it?
>  Knowing that TortoiseSVN is able to do something that the SVN command line
> client thinks is impossible is really eating at me.  I need to complete this
> task, but want to really explore all avenues before I do it the hard way.
>  What am I missing here?  How is TortoiseSVN able to perform an operation
> that I can't accomplish via the command line?

I think TSVN is just doing several standard operations behind the scenes.
Checkout a single file, set the property, commit the file.
You could still script this for the command line client
The problem with this approach is that it requires a separate commit
for every file that has the new property.

Simon

-- 
:       ___
:  oo  // \\      "De Chelonian Mobile"
: (_,\/ \_/ \     TortoiseSVN
:   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
:   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2678426
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2010-11-03 16:05:50 CET

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.