You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jim Paris <ji...@jtan.com> on 2005/10/24 00:58:40 UTC

EOL problems with "svn import"

I'm having issues with EOLs when dealing with vendor branches, and I
suspect it's due to a bug in "svn import".  This is all being run on a
Linux system, subversion 1.2.3 (r15833).

First, I have the following auto-prop in my ~/.subversion/config:
  
  [auto-props]
  *.dsp = svn:eol-style=CRLF
  
Now create a new repository:

  $ svnadmin create repo
  
Create two files with CRLF line endings:

  $ echo -ne 'test1\r\n' > test1.dsp
  $ echo -ne 'test2\r\n' > test2.dsp
  $ file test1.dsp test2.dsp
  test1.dsp: ASCII text, with CRLF line terminators
  test2.dsp: ASCII text, with CRLF line terminators

For the first, use "svn import":

  $ svn import test1.dsp file://`pwd`/repo -m 'import test1'
  Adding         test1.dsp

  Committed revision 1.

For the second, use "svn add":

  $ svn co file://`pwd`/repo wc
  A    wc/test1.dsp
  Checked out revision 1.
  $ cd wc
  $ cp ../test2.dsp .
  $ svn add test2.dsp
  A    test2.dsp
  $ svn commit -m 'add test2'
  Adding         test2.dsp
  Transmitting file data .
  Committed revision 2.

Now the two files appear similar:

  $ svn up
  At revision 2.
  $ file test1 test2
  test1.dsp: ASCII text, with CRLF line terminators
  test2.dsp: ASCII text, with CRLF line terminators
  $ svn propget svn:eol-style test1.dsp test2.dsp
  test1.dsp - CRLF
  test2.dsp - CRLF

But they're stored differently in the repository:

  $ file .svn/text-base/*
  .svn/text-base/test1.dsp.svn-base: ASCII text
  .svn/text-base/test2.dsp.svn-base: ASCII text, with CRLF line terminators

If I make any changes to test1.dsp and commit them, the entire file changes:

  $ echo -ne 'more\r\n' >> test1.dsp
  $ svn st
  M      test1.dsp
  $ svn diff
  Index: test1.dsp
  ===================================================================
  --- test1.dsp   (revision 2)
  +++ test1.dsp   (working copy)
  @@ -1 +1,2 @@
  -test1
  +test1
  +more
  
If I commit it, it now looks just like test2.dsp:

  $ svn commit -m 'change test1'
  Sending        test1.dsp
  Transmitting file data .
  Committed revision 3.
  $ file .svn/text-base/*
  .svn/text-base/test1.dsp.svn-base: ASCII text, with CRLF line terminators
  .svn/text-base/test2.dsp.svn-base: ASCII text, with CRLF line terminators

The problem I'm hitting is that merges get confused:

  $ cd ..
  $ svn co -r 2 file://`pwd`/repo wc-rev2
  A    wc-rev2/test1.dsp
  A    wc-rev2/test2.dsp
  Checked out revision 2.
  $ svn merge -r2:3 file://`pwd`/repo wc-rev2/
  C    wc-rev2/test1.dsp

when there really should have been no conflicts on that merge.

Sorry for the long mail.  Let me know if you need any more info.

-jim

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

Re: EOL problems with "svn import"

Posted by "C. Michael Pilato" <cm...@collab.net>.
Jim, I can confirm this behavior (and will annotate the issue with as
much).

Jim Paris <ji...@jtan.com> writes:

> I'm having issues with EOLs when dealing with vendor branches, and I
> suspect it's due to a bug in "svn import".  This is all being run on a
> Linux system, subversion 1.2.3 (r15833).
> 
> First, I have the following auto-prop in my ~/.subversion/config:
>   
>   [auto-props]
>   *.dsp = svn:eol-style=CRLF
>   
> Now create a new repository:
> 
>   $ svnadmin create repo
>   
> Create two files with CRLF line endings:
> 
>   $ echo -ne 'test1\r\n' > test1.dsp
>   $ echo -ne 'test2\r\n' > test2.dsp
>   $ file test1.dsp test2.dsp
>   test1.dsp: ASCII text, with CRLF line terminators
>   test2.dsp: ASCII text, with CRLF line terminators
> 
> For the first, use "svn import":
> 
>   $ svn import test1.dsp file://`pwd`/repo -m 'import test1'
>   Adding         test1.dsp
> 
>   Committed revision 1.
> 
> For the second, use "svn add":
> 
>   $ svn co file://`pwd`/repo wc
>   A    wc/test1.dsp
>   Checked out revision 1.
>   $ cd wc
>   $ cp ../test2.dsp .
>   $ svn add test2.dsp
>   A    test2.dsp
>   $ svn commit -m 'add test2'
>   Adding         test2.dsp
>   Transmitting file data .
>   Committed revision 2.
> 
> Now the two files appear similar:
> 
>   $ svn up
>   At revision 2.
>   $ file test1 test2
>   test1.dsp: ASCII text, with CRLF line terminators
>   test2.dsp: ASCII text, with CRLF line terminators
>   $ svn propget svn:eol-style test1.dsp test2.dsp
>   test1.dsp - CRLF
>   test2.dsp - CRLF
> 
> But they're stored differently in the repository:
> 
>   $ file .svn/text-base/*
>   .svn/text-base/test1.dsp.svn-base: ASCII text
>   .svn/text-base/test2.dsp.svn-base: ASCII text, with CRLF line terminators
> 
> If I make any changes to test1.dsp and commit them, the entire file changes:
> 
>   $ echo -ne 'more\r\n' >> test1.dsp
>   $ svn st
>   M      test1.dsp
>   $ svn diff
>   Index: test1.dsp
>   ===================================================================
>   --- test1.dsp   (revision 2)
>   +++ test1.dsp   (working copy)
>   @@ -1 +1,2 @@
>   -test1
>   +test1
>   +more
>   
> If I commit it, it now looks just like test2.dsp:
> 
>   $ svn commit -m 'change test1'
>   Sending        test1.dsp
>   Transmitting file data .
>   Committed revision 3.
>   $ file .svn/text-base/*
>   .svn/text-base/test1.dsp.svn-base: ASCII text, with CRLF line terminators
>   .svn/text-base/test2.dsp.svn-base: ASCII text, with CRLF line terminators
> 
> The problem I'm hitting is that merges get confused:
> 
>   $ cd ..
>   $ svn co -r 2 file://`pwd`/repo wc-rev2
>   A    wc-rev2/test1.dsp
>   A    wc-rev2/test2.dsp
>   Checked out revision 2.
>   $ svn merge -r2:3 file://`pwd`/repo wc-rev2/
>   C    wc-rev2/test1.dsp
> 
> when there really should have been no conflicts on that merge.
> 
> Sorry for the long mail.  Let me know if you need any more info.
> 
> -jim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 


-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

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