You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ben Kucenski <ka...@hotmail.com> on 2004/06/15 02:28:13 UTC

Binary files

I'm not sure the extent of Subversion handling binary files.  If I retrieve
an older revision of a binary file using SVN commands I get back something
that isn't the complete file and I have no idea what it is.

My work around is simply to automatically append the revision number to the
file when it's updated if it's a binary file.  When a binary file is
requested it checks to see what revision number the user wants and if that
file exists, the user gets that one, otherwise they get the file without a
revision number (the latest.)

The check to see if a file is binary, 256 bytes are read in and if any
characters are non-printable, it's treated as binary.  Subversion can
already tell the difference between plain text and binary files.  So I was
wondering if instead of having to code this functionality on top of SVN, if
it's a behavior that will be added.  Or if I'm simply missing something.

Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Binary files

Posted by Ben Collins-Sussman <su...@collab.net>.
On Mon, 2004-06-14 at 21:28, Ben Kucenski wrote:
> I'm not sure the extent of Subversion handling binary files.  If I retrieve
> an older revision of a binary file using SVN commands I get back something
> that isn't the complete file and I have no idea what it is.

Argh, you're telling us vague anecdotes again!  *Show* us the problem!

The Subversion repository has no idea if a file is text or binary.  It
treats file contents as literal bytes, end of story.  The client,
however, looks at the svn:mime-type property as a 'hint' to see if it's
okay to attempt contextual merges when updating files.

So I assure you, there's *nothing* wrong with Subversion's handling of
binary files, or any other kind of file.

For example, here's a command to retrieve the latest version of a PNG
file from Subversion's own repository:

$ svn cat 
http://svn.collab.net/repos/svn/trunk/doc/book/book/images/ch01dia1.png

If you want to get an older version of it, just add an -r flag:

$ svn cat -r8817
 http://svn.collab.net/repos/svn/trunk/doc/book/book/images/ch01dia1.png


You make a very serious claim, that "you're not getting back a complete
file".  Will you please *show us* a transcript of this problem?  Show us
the exact commands.

> 
> My work around is simply to automatically append the revision number to the
> file when it's updated if it's a binary file.  When a binary file is
> requested it checks to see what revision number the user wants and if that
> file exists, the user gets that one, otherwise they get the file without a
> revision number (the latest.)

And now you've lost me again.  I have no idea what you're talking
about.  Is this a *suggestion* you want us to implement?

Whatever the case, if you're having problems, show us.  Please.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org