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

Re: Skipping binary files when "svn diff" old revisions with incorrect svn:mime-type properties

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 19 Sep 2008 10:39:46 +0300 (Jerusalem Daylight Time)

Steve Strobel wrote on Thu, 18 Sep 2008 at 11:23 -0600:
> I am trying to generate a diff between two revisions with a command like
>
> svn diff svn://192.168.25.29/trunk_at_2 svn://192.168.25.29/trunk_at_232
>
> Unfortunately some of the files are binary but for some reason did not get
> their svn:mime-type property set to application/octet-stream, which causes
> the diff to end up with a bunch of unreadable binary characters in it. I
> would like diff to skip those files with a message like
>
> Cannot display: file marked as a binary type.
> svn:mime-type = application/octet-stream
>
> I hoped to accomplish this by retroactively setting the svn:mime-type
> property of each such file, so I added the following to the
> pre-revprop-change hook script (*.bat file under Windows with svnserve):
>
> IF "%SVN_PROPNAME%" == "svn:mime-type" exit 0
>

This script allows all revprop changes (since it never errors).

> I can now execute the propset command without getting an error message:
>
> svn propset --revprop -r 6 svn:mime-type application/octet-stream
> svn://192.168.25.29/trunk/vendors/AnalogDevices/RLC_DSP4/dsp4
> property 'svn:mime-type' set on repository revision 6
>
> but it doesn't seem to work. The diff still has the same problem and
> proplist doesn't show the property:
>
> svn proplist
> svn://192.168.25.29/trunk/vendors/AnalogDevices/RLC_DSP4/dsp4
> Properties on
> 'svn://192.168.25.29/trunk/vendors/AnalogDevices/RLC_DSP4/dsp4':
> svn:executable
>
> I am guessing that I can't change the properties retroactively like that for
> anything except svn:date, svn:author and svn:log because they are versioned
> and versions are immutable.

Yes and no. svn:date et al are only special as revprops, and
svn:mime-type et al are only special as versioned props. But as you
discovered, this isn't hard-coded to their names; you can create
a versioned prop svn:date and a revprop svn:mime-type.

You can also create your own props and revprops (with arbitrary names).

> As an aside, I think propset should give an
> error message when it is unable to do what you ask.

It did what you asked it to do: to set a *revprop* svn:mime-type. (I'm
not saying that improvements aren't possible -- make it warn, or improve
the docs -- only that it *could* do (and in fact did) what you asked.)

> I could add the
> property to the binary files in a working copy and commit them, but I don't
> think that is going to help me diff the older revisions (some of those files
> might not even exist in the working copy on head). Is there another way to
> get a diff without the binary files mucking it up?
>
> Thanks for any suggestions,
>
> Steve
>
>
> ---
> Steve Strobel
> Link Communications, Inc.
> 1035 Cerise Rd
> Billings, MT 59101-7378
> (406) 245-5002 ext 102
> (406) 245-4889 (fax)
> WWW: http://www.link-comm.com
> MailTo:steve.strobel_at_link-comm.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-09-19 09:40:19 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.