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

Re: Determining which files are treated as binary

From: Greg Thomas <thomasgd_at_omc.bt.co.uk>
Date: 2005-06-02 17:04:24 CEST

On Thu, 2 Jun 2005 10:16:05 -0400, Dominic Anello <danello@danky.com>
wrote:

>On 2005-06-02 09:11:51 +0100, Greg Thomas wrote:
>> On Wed, 01 Jun 2005 14:31:08 -0400, Christopher Ness
>> <chris@nesser.org> wrote:
>>
>> >On Wed, 2005-06-01 at 09:25 +0100, Greg Thomas wrote:
>> >> I'm trying to create a post-commit hook to set the svn:needs-lock
>> >> property on binary files - which should be simple enough.
>
>Properties *are* version-controlled. Revision properties aren't, but
>svn:mime-type isn't a rev prop.

Oops. It's a fair cop. I'm still struggling to get my head around what
a rev prop is, tbh.

> Furthermore, if you look at the help
>for svn propset, you'll see that ps without the --revprop flag only
>accepts PATHs as an argument, so you have to check out a working copy.
>Not to say it can't be done, but your hook script will both create
>additional revisions and need to manage working copies.

Well, it's certainly doable, it just adds an extra level of
complexity. As it's only an extra revision for every commit that
adds/updates a binary file that doesn't have the svn:needs-lock
property, it's not like it's going to fill up the repository with
small commits. Besides, it's not like I'm going to run out of revision
numbers ;-)

>IIRC, everything without a text/* mime-type will get treated as binary
>so just look for non-text mime-types:

Well, that's /nearly/ what the help for svn propset says - files
without a mime type are also treated as text (which I'd not noticed
before), though the example you gave will work fine. But given the
complexity of the post-commit script, I think I'll need something like
Perl;

 1. Check all committed files for binary-ness (sic) without svn:needs-lock
 2. If some found, checkout the highest directory with an affected file
 3. update binary files
 4. Commit changes
 5. Cleanup

Yuck. Wonder how long before svn propset works on a URL?
http://svn.haxx.se/users/archive-2003-09/0715.shtml says 30 minutes,
but that was nearly two years ago ;-)

Greg

-- 
This post represents the views of the author and does
not necessarily accurately represent the views of BT.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jun 2 17:30:57 2005

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