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

Re: Blame on .csv and .sql files ( files which SVN thinks are binary )

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-11-28 12:59:11 CET

On Nov 28, 2007, at 05:38, Ian Wood wrote:

>> On Nov 27, 2007, at 10:34, Ian Wood wrote:
>>
>>>> On Nov 26, 2007 9:10 AM, Ian Wood wrote:
>>>>
>>>>> Please can you tell me how I get SVN to blame .csv file and .sql
>>>>> files.
>>>>
>>>> Apply an appropriate svn:mime-type property to them.
>>>>
>>>> http://filext.com/file-extension/csv lists the mime-types commonly
>>>> used for CSV files (you probably want text/csv)
>>>>
>>>> The same site doesn't have a listing for SQL files, but since
>>>> they're
>>>> plain text, text/plain (which is what I use) should work fine.
>>>>
>>>> IIRC, Subversion treats any mime-type starting with text/ as plain
>>>> text.
>>>
>>> I have changed the property to text/plain in some CSV files and it
>>> works, however I have also done the same to some .sql files and it
>>> doesn't work. However the property is correctly set.
>>
>> Please show us the output of these two commands:
>>
>> svn proplist -v yourfile.sql
>>
>> svn blame yourfile.sql
>
> I opened up cmd.exe and the results are below.
>
>> svn proplist -v yourfile.sql
> Properties on 'yourfile.sql':
> svn:mime-type : text/plain
>
>> svn blame yourfile.sql
> Skipping binary file: 'yourfile.sql'

That's odd. And I can reproduce it with Subversion 1.4.5 on Mac OS X
10.4.11 Intel. Apparently Subversion doesn't work the way I thought
it worked......

$ svnadmin create repo
$ svn co file://`pwd`/repo wc
Checked out revision 0.
$ cd wc
$ date > foo.sql
$ date >> foo.sql
$ svn add foo.sql
A foo.sql
$ svn propset svn:mime-type "application/octet-stream" foo.sql
property 'svn:mime-type' set on 'foo.sql'
$ svn ci -m ""
Adding (bin) foo.sql
Transmitting file data .
Committed revision 1.
$ svn blame foo.sql
Skipping binary file: 'foo.sql'
$

# So far so hoopy. I told it to be a binary file so Subversion
# refuses to "blame" it. Now I want to make it a text file.

$ svn propset svn:mime-type "text/plain" foo.sql
property 'svn:mime-type' set on 'foo.sql'
$ svn blame foo.sql
Skipping binary file: 'foo.sql'
$ svn proplist -v foo.sql
Properties on 'foo.sql':
   svn:mime-type : text/plain
$

# Still doesn't work. Maybe I need to commit the property
# change first?

$ svn ci -m ""
Sending foo.sql

Committed revision 2.
$ svn blame foo.sql
Skipping binary file: 'foo.sql'
$

# Surprisingly (to me) it still doesn't allow "blame". By what
# criteria does Subversion still think this file is binary?

$ svn proplist -v foo.sql
Properties on 'foo.sql':
   svn:mime-type : text/plain
$ file foo.sql
foo.sql: ASCII text
$

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Nov 28 12:59:51 2007

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.