[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: Leeuw van der, Tim <tim.leeuwvander_at_nl.unisys.com>
Date: 2005-06-01 11:47:03 CEST

Hi Thomas,

Please keep me informed of the progress of your script, I'd love to use it.

I think that you can look at the svn properties of the file; it seems to me that if it's added binary it gets an svn:mime-type property 'application/octet-stream'.

However, if the user already sets the svn:mime-type property, or if autoprops sets it, then you can no longer test for svn:mime-type == 'application/octet-stream'. You'd have to check for svn:mime-type to be either absent (means text), or start with 'text/', or be another value that you know to be text... Then you can deduct it's a binary when it doesn't meet the criteria for being text.
A bit icky and tricky IMHO, which is why I haven't actually bothered to try to write such a script...

cheers,

--Tim

-----Original Message-----
From: Greg Thomas [mailto:thomasgd@omc.bt.co.uk]
Sent: Wednesday, June 01, 2005 10:26 AM
To: users@subversion.tigris.org
Subject: Determining which files are treated as binary

Hi,

I'm trying to create a post-commit hook to set the svn:needs-lock
property on binary files - which should be simple enough.

But, I'm having trouble determining which files are treated as binary
by Subversion. When a new file is added, you do get a (binary) note to
indicate this - e.g.
Adding (bin) test.gif
but AFAICT there's no way of pulling this binary status out using
svnlook or another similar command suitable for use from a hook.

What have I missed?

TIA,

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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jun 1 11:49:05 2005

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