You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Daniel Noll <da...@nuix.com> on 2007/06/28 02:36:56 UTC

svn diff and binary files

Hi all.

I'm experiencing some strange behaviour.  After converting our CVS repository 
over to Subversion, some of the files which were marked as binary on one side 
did not end up being marked as binary on the other.  But even after setting 
the MIME type explicitly, I'm not getting the behaviour I would expect.

  > svn propget svn:mime-type imagetest1.PNG
  application/octet-stream
  > diff imagetest1.PNG .svn/text-base/imagetest1.PNG.svn-base
  Files imagetest1.PNG and .svn/text-base/imagetest1.PNG.svn-base differ
  > svn diff imagetest1.PNG
  (no output)

The worst thing is if I make a change to any property on imagetest1.PNG and do 
a svn commit, it then reverts to the old and broken version of the file.

Version on the client is 1.4.3 (latest available in Cygwin), version on the 
server is 1.3.1 (latest available in Ubuntu, surprisingly.)

Daniel


-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

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

Re: svn diff and binary files

Posted by Arnauld Van Muysewinkel <ar...@gmail.com>.
2007/7/2, Daniel Noll <da...@nuix.com>:
> On Saturday 30 June 2007 09:31:36 Vineet Kumar wrote:
> > Afaik, cvs2svn looks at the only clue it has, which is whether the file
> > has "-kb" in the CVS repository.  Probably (some of) these PNGs didn't,
> > and so cvs2svn imported them as text (since that's what they were in the
> > CVS repository).  You might not notice the corruption on CVS if you were
> > working in an all LF environment, but once you tried to do a checkout on
> > windows, you'd have seen the CRLF corruption there too.
> >
> > Were you using subversion with mixed LF/CRLF clients?  What was the
> > svn:eol-style set to?  Same as with CVS: if you were working in an
> > all-LF environment you probably wouldn't notice the corruption.

I personally used an options file with the following setting:
<<
(...)
ctx.svn_property_setters = [
(...)
    BinaryFileEOLStyleSetter(),
    AutoPropsPropertySetter(
        '<path to svn config file>',
        True,
        ),
    BinaryFileDefaultMimeTypeSetter(),
    DefaultEOLStyleSetter('native'),
(...)
    ]

And my svn config file decides which are the binary files, through the
mime-type defined based on the file extension.

E.g. *.gif = svn:mime-type=image/gif;svn:needs-lock=true
and 'image/gif' is considered binary by svn because it does not start
with 'text/' (cf. SVN book, appendix B "Binary Files and Translation")


Yours faithfully,

-- 
Ir. Arnauld Van Muysewinkel

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

Re: svn diff and binary files

Posted by Daniel Noll <da...@nuix.com>.
On Saturday 30 June 2007 09:31:36 Vineet Kumar wrote:
> Afaik, cvs2svn looks at the only clue it has, which is whether the file
> has "-kb" in the CVS repository.  Probably (some of) these PNGs didn't,
> and so cvs2svn imported them as text (since that's what they were in the
> CVS repository).  You might not notice the corruption on CVS if you were
> working in an all LF environment, but once you tried to do a checkout on
> windows, you'd have seen the CRLF corruption there too.
>
> Were you using subversion with mixed LF/CRLF clients?  What was the
> svn:eol-style set to?  Same as with CVS: if you were working in an
> all-LF environment you probably wouldn't notice the corruption.

AFAIK we've always used LF clients, even under Windows, which would explain 
how it was possible not to notice this even when the file had been in CVS for 
ages before migrating over.

Daniel


-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

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

Re: svn diff and binary files

Posted by Vineet Kumar <vi...@doorstop.net>.
* Daniel Noll (daniel@nuix.com) [070627 23:27]:
> On Thursday 28 June 2007 16:16:37 Karl Fogel wrote:
> > Daniel Noll <da...@nuix.com> writes:
> > > I'm experiencing some strange behaviour.  After converting our CVS
> > > repository over to Subversion, some of the files which were marked as
> > > binary on one side did not end up being marked as binary on the other. 
> > > But even after setting the MIME type explicitly, I'm not getting the
> > > behaviour I would expect.
> >
> > You don't say how you converted your repository.  Did you use
> > cvs2svn (cvs2svn.tigris.org)?
> 
> Yeah.
> 
> I think I've discovered part of the issue, which was stray svn:eol-style 
> properties on some of the affected files.  No idea what that was doing on 
> binary files, but it was there, and I removed it now, fixing some of the 
> files.

Afaik, cvs2svn looks at the only clue it has, which is whether the file
has "-kb" in the CVS repository.  Probably (some of) these PNGs didn't,
and so cvs2svn imported them as text (since that's what they were in the
CVS repository).  You might not notice the corruption on CVS if you were
working in an all LF environment, but once you tried to do a checkout on
windows, you'd have seen the CRLF corruption there too.

Were you using subversion with mixed LF/CRLF clients?  What was the
svn:eol-style set to?  Same as with CVS: if you were working in an
all-LF environment you probably wouldn't notice the corruption.

The biggest difference between CVS and subversion in this area is how
they determine whether to merge when concurrent edits occur: subversion
looks for an svn:mime-type beginning with "text/", whereas CVS
determines it based on the "-kb" option.

Vineet

-- 
http://www.doorstop.net/
-- 
#include<stdio.h>
int main() {
    puts("Reader! Think not that \n"
         "technical information \n"
         "ought not be called speech;");
    return 0;
}

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

Re: svn diff and binary files

Posted by Daniel Noll <da...@nuix.com>.
On Thursday 28 June 2007 21:12:12 you wrote:
> On Jun 28, 2007, at 01:22, Daniel Noll wrote:
> > I think I've discovered part of the issue, which was stray svn:eol-
> > style
> > properties on some of the affected files.  No idea what that was
> > doing on
> > binary files, but it was there, and I removed it now, fixing some
> > of the
> > files.
>
> I was going to suggest that as a possible culprit. As you can
> probably imagine, setting svn:eol-style on a PNG will cause
> Subversion to normalize the EOL characters in the PNG -- which will
> irreparably corrupt it. So don't set svn:eol-style on binary files.

Normally I wouldn't, but in this case it was put there for me.  I assume this 
was the fault of the cvs2svn tool though, rather than the fault of the svn 
client.

Daniel

-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

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

Re: svn diff and binary files

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 28, 2007, at 01:22, Daniel Noll wrote:

> I think I've discovered part of the issue, which was stray svn:eol- 
> style
> properties on some of the affected files.  No idea what that was  
> doing on
> binary files, but it was there, and I removed it now, fixing some  
> of the
> files.

I was going to suggest that as a possible culprit. As you can  
probably imagine, setting svn:eol-style on a PNG will cause  
Subversion to normalize the EOL characters in the PNG -- which will  
irreparably corrupt it. So don't set svn:eol-style on binary files.



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

Re: svn diff and binary files

Posted by Daniel Noll <da...@nuix.com>.
On Thursday 28 June 2007 16:16:37 Karl Fogel wrote:
> Daniel Noll <da...@nuix.com> writes:
> > I'm experiencing some strange behaviour.  After converting our CVS
> > repository over to Subversion, some of the files which were marked as
> > binary on one side did not end up being marked as binary on the other. 
> > But even after setting the MIME type explicitly, I'm not getting the
> > behaviour I would expect.
>
> You don't say how you converted your repository.  Did you use
> cvs2svn (cvs2svn.tigris.org)?

Yeah.

I think I've discovered part of the issue, which was stray svn:eol-style 
properties on some of the affected files.  No idea what that was doing on 
binary files, but it was there, and I removed it now, fixing some of the 
files.

Daniel


-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

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

Re: svn diff and binary files

Posted by Karl Fogel <kf...@red-bean.com>.
Daniel Noll <da...@nuix.com> writes:
> I'm experiencing some strange behaviour.  After converting our CVS repository 
> over to Subversion, some of the files which were marked as binary on one side 
> did not end up being marked as binary on the other.  But even after setting 
> the MIME type explicitly, I'm not getting the behaviour I would expect.

You don't say how you converted your repository.  Did you use
cvs2svn (cvs2svn.tigris.org)?

-Karl

-- 
Subversion support & consulting  <>  http://producingoss.com/consulting.html

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