You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ming Zhang <mi...@ele.uri.edu> on 2006/07/27 17:58:46 UTC

handling binary file

Hi All

I met a strange problem. I migrate my code tree from sf.net (CVS) to
berlios (SVN). Then I found I have almost all binary files are broken.
And seems svn can not even detect this. I feel SVN treat all these
binary files as textual files.


For example, I have this pdf file Iometer.pdf.

$ ll
total 1052
drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
-rw-rw-r-- 1 mingz mingz 988246 May  3 11:02 Iometer.pdf
-rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw

Then I copy the correct file to overwrite it.

$ cp ../../../branches/IOMETER-restruct/iometer/Docs/Iometer.pdf .

See the file size changed.

$ ll
total 1056
drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
-rw-rw-r-- 1 mingz mingz 992633 Jul 27 13:53 Iometer.pdf
-rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw

But svn can not detect the file is changed.

$ svn st

How to correct this and let svn treat them as binary?

Thanks!
Ming



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

Re: handling binary file

Posted by Ming Zhang <mi...@ele.uri.edu>.
just to let you know that i solved this problem. by removing improper
property, overwriting with good files, and commit, i got it right.

Thank all for the help!

Ming


On Thu, 2006-07-27 at 19:18 -0400, Ming Zhang wrote:
> On Thu, 2006-07-27 at 17:27 -0500, Les Mikesell wrote:
> > On Thu, 2006-07-27 at 16:53 -0400, Ming Zhang wrote:
> > 
> > > > Funny you should say that -  comming from CVS. It's CVS that treats
> > > > files as binary or text. Normally as text and you need to supply an
> > > > extra flag (-kb) to tell CVS a file is binary.
> > > 
> > > i guess we did not do that on CVS.
> > 
> > I think at least some of the GUI interfaces to CVS (wincvs?) pre-scanned
> > the contents and made intelligent guesses about which ones needed the
> > -kb on the initial import or add.
> 
> it is back to 2003, guess nobody remember what happened at that
> time... :P
> 
> > 
> > > > 
> > > > SVN treats all files as binary and leaves the content alone, unless
> > > > you explicitly tell it not to. (Though in order to be able to diff and
> > > > merge, svn tries to make an estimate.)
> > 
> > SVN can't really change the fact that text files have different native
> > representations on different platforms - it just has the default
> > choice backwards from CVS.
> > 
> 
> yes. 
> 
> i already tweak the prop and overwrite with old good files. but now
> berlios svn server is running out of space, i have to commit later.
> 
> Ming
> 
> 

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

Re: handling binary file

Posted by Ming Zhang <mi...@ele.uri.edu>.
On Thu, 2006-07-27 at 17:27 -0500, Les Mikesell wrote:
> On Thu, 2006-07-27 at 16:53 -0400, Ming Zhang wrote:
> 
> > > Funny you should say that -  comming from CVS. It's CVS that treats
> > > files as binary or text. Normally as text and you need to supply an
> > > extra flag (-kb) to tell CVS a file is binary.
> > 
> > i guess we did not do that on CVS.
> 
> I think at least some of the GUI interfaces to CVS (wincvs?) pre-scanned
> the contents and made intelligent guesses about which ones needed the
> -kb on the initial import or add.

it is back to 2003, guess nobody remember what happened at that
time... :P

> 
> > > 
> > > SVN treats all files as binary and leaves the content alone, unless
> > > you explicitly tell it not to. (Though in order to be able to diff and
> > > merge, svn tries to make an estimate.)
> 
> SVN can't really change the fact that text files have different native
> representations on different platforms - it just has the default
> choice backwards from CVS.
> 

yes. 

i already tweak the prop and overwrite with old good files. but now
berlios svn server is running out of space, i have to commit later.

Ming


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

Re: handling binary file

Posted by Alex Turner <ar...@gmail.com>.
One of the problems is that a PDF file starts as a text file, and has binary
components later on, so a txt/bin detect will often pick up a PDF as being
text not binary.

Alex.

On 7/27/06, Les Mikesell <le...@gmail.com> wrote:
>
> On Thu, 2006-07-27 at 16:53 -0400, Ming Zhang wrote:
>
> > > Funny you should say that -  comming from CVS. It's CVS that treats
> > > files as binary or text. Normally as text and you need to supply an
> > > extra flag (-kb) to tell CVS a file is binary.
> >
> > i guess we did not do that on CVS.
>
> I think at least some of the GUI interfaces to CVS (wincvs?) pre-scanned
> the contents and made intelligent guesses about which ones needed the
> -kb on the initial import or add.
>
> > >
> > > SVN treats all files as binary and leaves the content alone, unless
> > > you explicitly tell it not to. (Though in order to be able to diff and
> > > merge, svn tries to make an estimate.)
>
> SVN can't really change the fact that text files have different native
> representations on different platforms - it just has the default
> choice backwards from CVS.
>
> --
>   Les Mikesell
>    lesmikesell@gmail.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

Re: handling binary file

Posted by Les Mikesell <le...@gmail.com>.
On Thu, 2006-07-27 at 16:53 -0400, Ming Zhang wrote:

> > Funny you should say that -  comming from CVS. It's CVS that treats
> > files as binary or text. Normally as text and you need to supply an
> > extra flag (-kb) to tell CVS a file is binary.
> 
> i guess we did not do that on CVS.

I think at least some of the GUI interfaces to CVS (wincvs?) pre-scanned
the contents and made intelligent guesses about which ones needed the
-kb on the initial import or add.

> > 
> > SVN treats all files as binary and leaves the content alone, unless
> > you explicitly tell it not to. (Though in order to be able to diff and
> > merge, svn tries to make an estimate.)

SVN can't really change the fact that text files have different native
representations on different platforms - it just has the default
choice backwards from CVS.

-- 
  Les Mikesell
   lesmikesell@gmail.com


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

Re: handling binary file

Posted by Ming Zhang <mi...@ele.uri.edu>.
On Thu, 2006-07-27 at 22:41 +0200, Erik Huelsmann wrote:
> On 7/27/06, Ming Zhang <mi...@ele.uri.edu> wrote:
> > Hi All
> >
> > I met a strange problem. I migrate my code tree from sf.net (CVS) to
> > berlios (SVN). Then I found I have almost all binary files are broken.
> > And seems svn can not even detect this. I feel SVN treat all these
> > binary files as textual files.
> 
> Funny you should say that -  comming from CVS. It's CVS that treats
> files as binary or text. Normally as text and you need to supply an
> extra flag (-kb) to tell CVS a file is binary.

i guess we did not do that on CVS.


> 
> SVN treats all files as binary and leaves the content alone, unless
> you explicitly tell it not to. (Though in order to be able to diff and
> merge, svn tries to make an estimate.)
> 
> > For example, I have this pdf file Iometer.pdf.
> >
> > $ ll
> > total 1052
> > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > -rw-rw-r-- 1 mingz mingz 988246 May  3 11:02 Iometer.pdf
> > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> >
> > Then I copy the correct file to overwrite it.
> >
> > $ cp ../../../branches/IOMETER-restruct/iometer/Docs/Iometer.pdf .
> >
> > See the file size changed.
> >
> > $ ll
> > total 1056
> > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > -rw-rw-r-- 1 mingz mingz 992633 Jul 27 13:53 Iometer.pdf
> > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> >
> > But svn can not detect the file is changed.
> >
> > $ svn st
> 
> Ok, that's strange. What's the output of 'svn status --verbose'?

this is part of the svn st -v. looks like no change detected.

              266       10 ndabney      Iometer_Files/image165.jpg
              266       10 ndabney      Iometer_Files/image166.jpg
              266       10 ndabney      Iometer_Files/image086.jpg
              266       10 ndabney      Iometer_Files/image167.jpg
              266       10 ndabney      Iometer_Files/image168.jpg
              266       10 ndabney      Iometer_Files/image088.jpg
              266       10 ndabney      Iometer_Files/image169.jpg
              266       92 xca1019      Iometer.pdf

if i do

$ rm Iometer.pdf
$ svn revert Iometer.pdf
Reverted 'Iometer.pdf'
$ ll
total 1052
drwxrwxr-x 4 mingz mingz   4096 May  3 11:03 Docbook
drwxrwxr-x 3 mingz mingz   4096 May  3 11:03 Iometer_Files
-rw-rw-r-- 1 mingz mingz 988246 Jul 27 16:48 Iometer.pdf
-rw-rw-r-- 1 mingz mingz  68531 Jul 27 11:02 Iometer.sxw

u can see the file go back to old size again. so it is recovered to old
file.


> 
> > How to correct this and let svn treat them as binary?
> 
> SVN already does. You may need to tell CVS to do this (treating as
> binary) to make sure your files are correctly migrated to svn...

now the problem is i migrated last year and never notice this binary
file, i mainly work on source code. then after many commit in svn, it is
hard for me to restart from scratch.

also another information is if i check out from cvs, these files are not
corrupted.


so is there a way to mark one file as modified and commit it even svn
did not detect the change?

my last way will be svn rm it, and svn add back. that is messy...


Thanks!

Ming



> 
> Hope that helps,
> 
> 
> Erik.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 

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

Re: handling binary file

Posted by Erik Huelsmann <eh...@gmail.com>.
On 7/27/06, Ming Zhang <mi...@ele.uri.edu> wrote:
> Hi All
>
> I met a strange problem. I migrate my code tree from sf.net (CVS) to
> berlios (SVN). Then I found I have almost all binary files are broken.
> And seems svn can not even detect this. I feel SVN treat all these
> binary files as textual files.

Funny you should say that -  comming from CVS. It's CVS that treats
files as binary or text. Normally as text and you need to supply an
extra flag (-kb) to tell CVS a file is binary.

SVN treats all files as binary and leaves the content alone, unless
you explicitly tell it not to. (Though in order to be able to diff and
merge, svn tries to make an estimate.)

> For example, I have this pdf file Iometer.pdf.
>
> $ ll
> total 1052
> drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> -rw-rw-r-- 1 mingz mingz 988246 May  3 11:02 Iometer.pdf
> -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
>
> Then I copy the correct file to overwrite it.
>
> $ cp ../../../branches/IOMETER-restruct/iometer/Docs/Iometer.pdf .
>
> See the file size changed.
>
> $ ll
> total 1056
> drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> -rw-rw-r-- 1 mingz mingz 992633 Jul 27 13:53 Iometer.pdf
> -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
>
> But svn can not detect the file is changed.
>
> $ svn st

Ok, that's strange. What's the output of 'svn status --verbose'?

> How to correct this and let svn treat them as binary?

SVN already does. You may need to tell CVS to do this (treating as
binary) to make sure your files are correctly migrated to svn...

Hope that helps,


Erik.

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

Re: handling binary file

Posted by Ming Zhang <mi...@ele.uri.edu>.
On Thu, 2006-07-27 at 17:04 -0400, Ming Zhang wrote:
> On Thu, 2006-07-27 at 23:02 +0200, Erik Huelsmann wrote:
> > On 7/27/06, Ming Zhang <mi...@ele.uri.edu> wrote:
> > > On Thu, 2006-07-27 at 22:47 +0200, Ryan Schmidt wrote:
> > > > On Jul 27, 2006, at 19:58, Ming Zhang wrote:
> > > >
> > > > > I met a strange problem. I migrate my code tree from sf.net (CVS) to
> > > > > berlios (SVN). Then I found I have almost all binary files are broken.
> > > > > And seems svn can not even detect this. I feel SVN treat all these
> > > > > binary files as textual files.
> > > >
> > > > Are you sure the files aren't already broken in CVS? I haven't used
> > > > CVS, but I understand it's easy to corrupt binary files in CVS by
> > > > forgetting to tell CVS that they're binary.
> > >
> > > i just check out from cvs and these files are ok.
> > >
> > > >
> > > > Subversion treats all files as binary and won't muck with them unless
> > > > you tell it to. For example, if you tell it to do line-ending
> > > > conversion (svn:eol-style property) or keyword expansion
> > > > (svn:keywords property) it will do this, even on binary files; this
> > > > will probably destroy most kinds of binary files, so you should not
> > > > ask Subversion to do these kinds of operations on binary files.
> > >
> > > i never did this. in fact, i just know this today by googling because of
> > > this problem. :P
> > >
> > > >
> > > > There's also the matter of the MIME type (svn:mime-type property).
> > > > Have you set the MIME type of these files to a text/* MIME type or a
> > > > binary MIME type? A good MIME type for PDF files for example would be
> > > > application/pdf.
> > > >
> > > >
> > > > > For example, I have this pdf file Iometer.pdf.
> > > > >
> > > > > $ ll
> > > > > total 1052
> > > > > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > > > > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > > > > -rw-rw-r-- 1 mingz mingz 988246 May  3 11:02 Iometer.pdf
> > > > > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> > > > >
> > > > > Then I copy the correct file to overwrite it.
> > > > >
> > > > > $ cp ../../../branches/IOMETER-restruct/iometer/Docs/Iometer.pdf .
> > > > >
> > > > > See the file size changed.
> > > > >
> > > > > $ ll
> > > > > total 1056
> > > > > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > > > > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > > > > -rw-rw-r-- 1 mingz mingz 992633 Jul 27 13:53 Iometer.pdf
> > > > > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> > > > >
> > > > > But svn can not detect the file is changed.
> > > > >
> > > > > $ svn st
> > > > >
> > > > > How to correct this and let svn treat them as binary?
> > > >
> > > > That seems also to point towards improper svn:eol-style or
> > > > svn:keywords properties being used. What do you see if you say "svn
> > > > proplist -v Iometer.pdf"?
> > > >
> > >
> > > $ svn proplist -v Iometer.pdf
> > > Properties on 'Iometer.pdf':
> > >   svn:keywords : Author Date Id Revision
> > >   svn:eol-style : native
> > 
> > > i have this. i guess native is a default good choice?
> > 
> > Well, not in this case: you explicitly asked Subversion to treat your
> > binary file as texty... You could remove both properties and then copy
> 
> could you explain a bit more on this?

found out via web. thx.


> 
> 
> > the undamaged file in. Maybe that helps? Also, the date on the file
> > needs to be newer than the date on the file when it is restored
> > through revert.
> 
> ok. i will try this.
> 
> > 
> > HTH,
> > 
> > Erik.
> 

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

Re: handling binary file

Posted by Ming Zhang <mi...@ele.uri.edu>.
On Thu, 2006-07-27 at 23:02 +0200, Erik Huelsmann wrote:
> On 7/27/06, Ming Zhang <mi...@ele.uri.edu> wrote:
> > On Thu, 2006-07-27 at 22:47 +0200, Ryan Schmidt wrote:
> > > On Jul 27, 2006, at 19:58, Ming Zhang wrote:
> > >
> > > > I met a strange problem. I migrate my code tree from sf.net (CVS) to
> > > > berlios (SVN). Then I found I have almost all binary files are broken.
> > > > And seems svn can not even detect this. I feel SVN treat all these
> > > > binary files as textual files.
> > >
> > > Are you sure the files aren't already broken in CVS? I haven't used
> > > CVS, but I understand it's easy to corrupt binary files in CVS by
> > > forgetting to tell CVS that they're binary.
> >
> > i just check out from cvs and these files are ok.
> >
> > >
> > > Subversion treats all files as binary and won't muck with them unless
> > > you tell it to. For example, if you tell it to do line-ending
> > > conversion (svn:eol-style property) or keyword expansion
> > > (svn:keywords property) it will do this, even on binary files; this
> > > will probably destroy most kinds of binary files, so you should not
> > > ask Subversion to do these kinds of operations on binary files.
> >
> > i never did this. in fact, i just know this today by googling because of
> > this problem. :P
> >
> > >
> > > There's also the matter of the MIME type (svn:mime-type property).
> > > Have you set the MIME type of these files to a text/* MIME type or a
> > > binary MIME type? A good MIME type for PDF files for example would be
> > > application/pdf.
> > >
> > >
> > > > For example, I have this pdf file Iometer.pdf.
> > > >
> > > > $ ll
> > > > total 1052
> > > > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > > > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > > > -rw-rw-r-- 1 mingz mingz 988246 May  3 11:02 Iometer.pdf
> > > > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> > > >
> > > > Then I copy the correct file to overwrite it.
> > > >
> > > > $ cp ../../../branches/IOMETER-restruct/iometer/Docs/Iometer.pdf .
> > > >
> > > > See the file size changed.
> > > >
> > > > $ ll
> > > > total 1056
> > > > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > > > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > > > -rw-rw-r-- 1 mingz mingz 992633 Jul 27 13:53 Iometer.pdf
> > > > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> > > >
> > > > But svn can not detect the file is changed.
> > > >
> > > > $ svn st
> > > >
> > > > How to correct this and let svn treat them as binary?
> > >
> > > That seems also to point towards improper svn:eol-style or
> > > svn:keywords properties being used. What do you see if you say "svn
> > > proplist -v Iometer.pdf"?
> > >
> >
> > $ svn proplist -v Iometer.pdf
> > Properties on 'Iometer.pdf':
> >   svn:keywords : Author Date Id Revision
> >   svn:eol-style : native
> 
> > i have this. i guess native is a default good choice?
> 
> Well, not in this case: you explicitly asked Subversion to treat your
> binary file as texty... You could remove both properties and then copy

could you explain a bit more on this?


> the undamaged file in. Maybe that helps? Also, the date on the file
> needs to be newer than the date on the file when it is restored
> through revert.

ok. i will try this.

> 
> HTH,
> 
> Erik.

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

Re: handling binary file

Posted by Erik Huelsmann <eh...@gmail.com>.
On 7/27/06, Ming Zhang <mi...@ele.uri.edu> wrote:
> On Thu, 2006-07-27 at 22:47 +0200, Ryan Schmidt wrote:
> > On Jul 27, 2006, at 19:58, Ming Zhang wrote:
> >
> > > I met a strange problem. I migrate my code tree from sf.net (CVS) to
> > > berlios (SVN). Then I found I have almost all binary files are broken.
> > > And seems svn can not even detect this. I feel SVN treat all these
> > > binary files as textual files.
> >
> > Are you sure the files aren't already broken in CVS? I haven't used
> > CVS, but I understand it's easy to corrupt binary files in CVS by
> > forgetting to tell CVS that they're binary.
>
> i just check out from cvs and these files are ok.
>
> >
> > Subversion treats all files as binary and won't muck with them unless
> > you tell it to. For example, if you tell it to do line-ending
> > conversion (svn:eol-style property) or keyword expansion
> > (svn:keywords property) it will do this, even on binary files; this
> > will probably destroy most kinds of binary files, so you should not
> > ask Subversion to do these kinds of operations on binary files.
>
> i never did this. in fact, i just know this today by googling because of
> this problem. :P
>
> >
> > There's also the matter of the MIME type (svn:mime-type property).
> > Have you set the MIME type of these files to a text/* MIME type or a
> > binary MIME type? A good MIME type for PDF files for example would be
> > application/pdf.
> >
> >
> > > For example, I have this pdf file Iometer.pdf.
> > >
> > > $ ll
> > > total 1052
> > > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > > -rw-rw-r-- 1 mingz mingz 988246 May  3 11:02 Iometer.pdf
> > > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> > >
> > > Then I copy the correct file to overwrite it.
> > >
> > > $ cp ../../../branches/IOMETER-restruct/iometer/Docs/Iometer.pdf .
> > >
> > > See the file size changed.
> > >
> > > $ ll
> > > total 1056
> > > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > > -rw-rw-r-- 1 mingz mingz 992633 Jul 27 13:53 Iometer.pdf
> > > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> > >
> > > But svn can not detect the file is changed.
> > >
> > > $ svn st
> > >
> > > How to correct this and let svn treat them as binary?
> >
> > That seems also to point towards improper svn:eol-style or
> > svn:keywords properties being used. What do you see if you say "svn
> > proplist -v Iometer.pdf"?
> >
>
> $ svn proplist -v Iometer.pdf
> Properties on 'Iometer.pdf':
>   svn:keywords : Author Date Id Revision
>   svn:eol-style : native

> i have this. i guess native is a default good choice?

Well, not in this case: you explicitly asked Subversion to treat your
binary file as texty... You could remove both properties and then copy
the undamaged file in. Maybe that helps? Also, the date on the file
needs to be newer than the date on the file when it is restored
through revert.

HTH,

Erik.

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

Re: handling binary file

Posted by Ming Zhang <mi...@ele.uri.edu>.
On Thu, 2006-07-27 at 22:47 +0200, Ryan Schmidt wrote:
> On Jul 27, 2006, at 19:58, Ming Zhang wrote:
> 
> > I met a strange problem. I migrate my code tree from sf.net (CVS) to
> > berlios (SVN). Then I found I have almost all binary files are broken.
> > And seems svn can not even detect this. I feel SVN treat all these
> > binary files as textual files.
> 
> Are you sure the files aren't already broken in CVS? I haven't used  
> CVS, but I understand it's easy to corrupt binary files in CVS by  
> forgetting to tell CVS that they're binary.

i just check out from cvs and these files are ok.

> 
> Subversion treats all files as binary and won't muck with them unless  
> you tell it to. For example, if you tell it to do line-ending  
> conversion (svn:eol-style property) or keyword expansion  
> (svn:keywords property) it will do this, even on binary files; this  
> will probably destroy most kinds of binary files, so you should not  
> ask Subversion to do these kinds of operations on binary files.

i never did this. in fact, i just know this today by googling because of
this problem. :P

> 
> There's also the matter of the MIME type (svn:mime-type property).  
> Have you set the MIME type of these files to a text/* MIME type or a  
> binary MIME type? A good MIME type for PDF files for example would be  
> application/pdf.
> 
> 
> > For example, I have this pdf file Iometer.pdf.
> >
> > $ ll
> > total 1052
> > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > -rw-rw-r-- 1 mingz mingz 988246 May  3 11:02 Iometer.pdf
> > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> >
> > Then I copy the correct file to overwrite it.
> >
> > $ cp ../../../branches/IOMETER-restruct/iometer/Docs/Iometer.pdf .
> >
> > See the file size changed.
> >
> > $ ll
> > total 1056
> > drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> > drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> > -rw-rw-r-- 1 mingz mingz 992633 Jul 27 13:53 Iometer.pdf
> > -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
> >
> > But svn can not detect the file is changed.
> >
> > $ svn st
> >
> > How to correct this and let svn treat them as binary?
> 
> That seems also to point towards improper svn:eol-style or  
> svn:keywords properties being used. What do you see if you say "svn  
> proplist -v Iometer.pdf"?
> 

$ svn proplist -v Iometer.pdf
Properties on 'Iometer.pdf':
  svn:keywords : Author Date Id Revision
  svn:eol-style : native

i have this. i guess native is a default good choice?

Ming


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

Re: handling binary file

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 27, 2006, at 19:58, Ming Zhang wrote:

> I met a strange problem. I migrate my code tree from sf.net (CVS) to
> berlios (SVN). Then I found I have almost all binary files are broken.
> And seems svn can not even detect this. I feel SVN treat all these
> binary files as textual files.

Are you sure the files aren't already broken in CVS? I haven't used  
CVS, but I understand it's easy to corrupt binary files in CVS by  
forgetting to tell CVS that they're binary.

Subversion treats all files as binary and won't muck with them unless  
you tell it to. For example, if you tell it to do line-ending  
conversion (svn:eol-style property) or keyword expansion  
(svn:keywords property) it will do this, even on binary files; this  
will probably destroy most kinds of binary files, so you should not  
ask Subversion to do these kinds of operations on binary files.

There's also the matter of the MIME type (svn:mime-type property).  
Have you set the MIME type of these files to a text/* MIME type or a  
binary MIME type? A good MIME type for PDF files for example would be  
application/pdf.


> For example, I have this pdf file Iometer.pdf.
>
> $ ll
> total 1052
> drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> -rw-rw-r-- 1 mingz mingz 988246 May  3 11:02 Iometer.pdf
> -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
>
> Then I copy the correct file to overwrite it.
>
> $ cp ../../../branches/IOMETER-restruct/iometer/Docs/Iometer.pdf .
>
> See the file size changed.
>
> $ ll
> total 1056
> drwxrwxr-x 4 mingz mingz   4096 May  3 11:02 Docbook
> drwxrwxr-x 3 mingz mingz   4096 May  3 11:02 Iometer_Files
> -rw-rw-r-- 1 mingz mingz 992633 Jul 27 13:53 Iometer.pdf
> -rw-rw-r-- 1 mingz mingz  68529 May  3 11:02 Iometer.sxw
>
> But svn can not detect the file is changed.
>
> $ svn st
>
> How to correct this and let svn treat them as binary?

That seems also to point towards improper svn:eol-style or  
svn:keywords properties being used. What do you see if you say "svn  
proplist -v Iometer.pdf"?




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