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

RE: How does Subversion decide what gets automatically merged?

From: Karan, Cem (Civ, ARL/CISD) <CKaran_at_arl.army.mil>
Date: 2007-08-13 13:30:19 CEST

OK, in that case, my guess was right, but it is also a warning that it
is a really, really good idea to define MIME types for every file that
you plan to load into Subversion. One simple trick I've used for making
binary data platform independent involves prefacing all the data with an
ASCII metadata string. The application loads up the first X bytes (all
printable 7-bit ASCII), figures out from that what the binary format for
the rest of the data is going to be, and then loads in the rest of the
data from the same file. Subversion will chew that up instantly.

Thanks for all the help!

Cem Karan

-----Original Message-----
From: Erik Huelsmann [mailto:ehuels@gmail.com]
Sent: Saturday, August 11, 2007 5:01 AM
To: Ryan Schmidt
Cc: Rainer Sokoll; Karan, Cem (Civ, ARL/CISD);
Subject: Re: How does Subversion decide what gets automatically merged?

On 8/11/07, Ryan Schmidt <subversion-2007b@ryandesign.com> wrote:
> On Aug 10, 2007, at 07:55, Rainer Sokoll wrote:
> > On Fri, Aug 10, 2007 at 08:48:17AM -0400, Cem Karan wrote:
> >
> >> Do you know the exact file types it thinks of as plain text? I
> >> mean, does it look at a file, determine that it is all 7-bit
> >> printable ASCII, and from that guess that it is text, or is there
> >> a master list of filename types that it looks at and guesses from
> >> that which are text?
> >
> > The Book says: it's based on the MIME type:
> > http://svnbook.red-bean.com/nightly/en/svn.forcvs.binary-and-
> > trans.html
> Yes, but as it says at the end of that page, svn import will
> automatically assign an svn:mime-type to a file based on some magic
> which is not described. In any case, you can bypass the magic by
> defining in your ~/.subversion/config file which filename extensions
> should be mapped to which MIME types.

I looked up the rule in the source code it is:

Inspecting the first 1024 bytes in the file,
- 85% or more must be in the ranges 0x07-0x0D and 0x20-0x7F
- None of the bytes may be 0x00

If the above holds, the file is probably texty in the sense that it can
be merged. Consider it binary otherwise.



To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 13 13:26:18 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.