You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Küng <to...@gmail.com> on 2006/06/02 20:48:03 UTC

Version 1.4.0: svn st errors out

Hi,

The following recipe produces an error when running 'svn st':

$ svnadmin create repo
$ svn co file:///d:/test/repo wc
now create two files with some dummy lines in them. One file must have 
CRLF lineendings, the other LF lineendings.
$ move CRLF-File.txt wc\file.txt
$ svn add wc\file.txt
$ svn ci wc -m ""
$ svn propset svn:eol-style native wc\file.txt
$ move LF-File.txt wc\file.txt

Now, we have overwritten the file with CRLF lineendings with a file that 
has only LF lineendings. And the file has the svn:eol-style property set 
to native.

$ svn st wc
svn: inconsistent line ending style

This happens only with an svn.exe compiled from the 1.4.x branch. The 
1.3.x versions correctly reports:
M      wc\file.txt

The problem with the 1.4.x behavior is (IMHO) that
1. It returns an error. 'svn st' should not error out if the working 
copy is not corrupt. Problems with line endings styles should either be 
reported with some status letter or be ignored in that function.
2. The error message is pretty much useless. Imagine you have a working 
copy folder with thousands of files in it and several subfolders: happy 
hunting the file with the "inconsistent line ending style" :)

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

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

Re: Version 1.4.0: svn st errors out

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/6/06, Stefan Küng <to...@gmail.com> wrote:
> Garrett Rooney wrote:
>
> > (On a side note, where in the code is this?  The only translation code
> > that looks promising is in libsvn_wc/diff.c, does libsvn_wc/status.c
> > end up calling in there?  I can't actually seem to reproduce the
> > actual error on a unix machine, so I can't just look at the
> > maintainer-mode error to see where it came from...)
>
> Did you set the svn:eol-style property? If the property isn't set, then
> 'svn st' works fine.

Yeah, I had it set, it didn't seem to matter.

-garrett

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


Re: Version 1.4.0: svn st errors out

Posted by Stefan Küng <to...@gmail.com>.
Garrett Rooney wrote:

> (On a side note, where in the code is this?  The only translation code
> that looks promising is in libsvn_wc/diff.c, does libsvn_wc/status.c
> end up calling in there?  I can't actually seem to reproduce the
> actual error on a unix machine, so I can't just look at the
> maintainer-mode error to see where it came from...)

Did you set the svn:eol-style property? If the property isn't set, then 
'svn st' works fine.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

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

Re: Version 1.4.0: svn st errors out

Posted by Stefan Küng <to...@gmail.com>.
Garrett Rooney wrote:
> On 6/6/06, C. Michael Pilato <cm...@collab.net> wrote:
> 
>> I have not reproduced this problem either -- am just reading code.  
>> So, what
>> previously I writ, and what followeth from my hand, might be, as they 
>> say in
>> the Greek, "hogwash".
> 
> Well, in the spirit of totally untested fixes, here's a patch that may 
> do it...
> 
> Stefan, if you could give this a shot, I'd appreciate it.

Currently building with your patch. I'll report back when my build is 
finished (can take a while though...)

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

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

Re: Version 1.4.0: svn st errors out

Posted by Stefan Küng <to...@gmail.com>.
Garrett Rooney wrote:
> On 6/6/06, Stefan Küng <to...@gmail.com> wrote:
> 
>> Good point! Actually, I have a debug build ready, but for some unknown
>> reason I used the release build to test it.
>>
>> But I found it anyway by stepping through the code. Your patch checks
>> the return value in line 302 in file questions.c. But the function
>> actually fails some lines below:
>>
>>        if (! v_stream)
>>          {
>>            same = FALSE;
>>          }
>>        else
>>          {
>>            SVN_ERR(svn_stream_contents_same(&same, b_stream, v_stream,
>> pool));
>>
>>            SVN_ERR(svn_stream_close(v_stream));
>>          }
>>
>> It fails in svn_stream_contents_same(), there the error
>> SVN_ERR_IO_INCONSISTENT_EOL is returned.
> 
> Ahh, ok.  Here, try this.

Already building with the exact same patch (now I wonder why I replaced 
the tabs from my editor with spaces - I could have just waited for your 
patch :)

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

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

Re: Version 1.4.0: svn st errors out

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/6/06, Stefan Küng <to...@gmail.com> wrote:
> Garrett Rooney wrote:
> > On 6/6/06, Stefan Küng <to...@gmail.com> wrote:
> >
> >> Good point! Actually, I have a debug build ready, but for some unknown
> >> reason I used the release build to test it.
> >>
> >> But I found it anyway by stepping through the code. Your patch checks
> >> the return value in line 302 in file questions.c. But the function
> >> actually fails some lines below:
> >>
> >>        if (! v_stream)
> >>          {
> >>            same = FALSE;
> >>          }
> >>        else
> >>          {
> >>            SVN_ERR(svn_stream_contents_same(&same, b_stream, v_stream,
> >> pool));
> >>
> >>            SVN_ERR(svn_stream_close(v_stream));
> >>          }
> >>
> >> It fails in svn_stream_contents_same(), there the error
> >> SVN_ERR_IO_INCONSISTENT_EOL is returned.
> >
> > Ahh, ok.  Here, try this.
>
> Sorry for the delay. I had to do a complete rebuild after the batteries
> on my laptop died (haven't noticed that the cable was not plugged in).
>
> The patch works great! Now the status of such files is shown as modified
> and 'svn st' doesn't error out anymore.

Cool, committed to trunk in r19971.  Will propose for backport to 1.4.x.

-garrett

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


Re: Version 1.4.0: svn st errors out

Posted by Stefan Küng <to...@gmail.com>.
Garrett Rooney wrote:
> On 6/6/06, Stefan Küng <to...@gmail.com> wrote:
> 
>> Good point! Actually, I have a debug build ready, but for some unknown
>> reason I used the release build to test it.
>>
>> But I found it anyway by stepping through the code. Your patch checks
>> the return value in line 302 in file questions.c. But the function
>> actually fails some lines below:
>>
>>        if (! v_stream)
>>          {
>>            same = FALSE;
>>          }
>>        else
>>          {
>>            SVN_ERR(svn_stream_contents_same(&same, b_stream, v_stream,
>> pool));
>>
>>            SVN_ERR(svn_stream_close(v_stream));
>>          }
>>
>> It fails in svn_stream_contents_same(), there the error
>> SVN_ERR_IO_INCONSISTENT_EOL is returned.
> 
> Ahh, ok.  Here, try this.

Sorry for the delay. I had to do a complete rebuild after the batteries 
on my laptop died (haven't noticed that the cable was not plugged in).

The patch works great! Now the status of such files is shown as modified 
and 'svn st' doesn't error out anymore.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

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

Re: Version 1.4.0: svn st errors out

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/6/06, Stefan Küng <to...@gmail.com> wrote:

> Good point! Actually, I have a debug build ready, but for some unknown
> reason I used the release build to test it.
>
> But I found it anyway by stepping through the code. Your patch checks
> the return value in line 302 in file questions.c. But the function
> actually fails some lines below:
>
>        if (! v_stream)
>          {
>            same = FALSE;
>          }
>        else
>          {
>            SVN_ERR(svn_stream_contents_same(&same, b_stream, v_stream,
> pool));
>
>            SVN_ERR(svn_stream_close(v_stream));
>          }
>
> It fails in svn_stream_contents_same(), there the error
> SVN_ERR_IO_INCONSISTENT_EOL is returned.

Ahh, ok.  Here, try this.

-garrett

Re: Version 1.4.0: svn st errors out

Posted by Stefan Küng <to...@gmail.com>.
Garrett Rooney wrote:
> On 6/6/06, Stefan Küng <to...@gmail.com> wrote:
>> Garrett Rooney wrote:
>> > On 6/6/06, C. Michael Pilato <cm...@collab.net> wrote:
>> >
>> >> I have not reproduced this problem either -- am just reading code.
>> >> So, what
>> >> previously I writ, and what followeth from my hand, might be, as they
>> >> say in
>> >> the Greek, "hogwash".
>> >
>> > Well, in the spirit of totally untested fixes, here's a patch that may
>> > do it...
>> >
>> > Stefan, if you could give this a shot, I'd appreciate it.
>>
>> Sorry, but I still get the error "inconsistent line ending style".
>> I'll try stepping through the code and see what I can find out...
> 
> Building in maintainer mode (is there an easy way to do that on
> win32?) would be useful, as it could tell you the line number and file
> the error is originating in, which means its easy to get a backtrace
> and figure out where the error isn't getting handled...

Good point! Actually, I have a debug build ready, but for some unknown 
reason I used the release build to test it.

But I found it anyway by stepping through the code. Your patch checks 
the return value in line 302 in file questions.c. But the function 
actually fails some lines below:

       if (! v_stream)
         {
           same = FALSE;
         }
       else
         {
           SVN_ERR(svn_stream_contents_same(&same, b_stream, v_stream, 
pool));

           SVN_ERR(svn_stream_close(v_stream));
         }

It fails in svn_stream_contents_same(), there the error 
SVN_ERR_IO_INCONSISTENT_EOL is returned.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

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

Re: Version 1.4.0: svn st errors out

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/6/06, Stefan Küng <to...@gmail.com> wrote:
> Garrett Rooney wrote:
> > On 6/6/06, C. Michael Pilato <cm...@collab.net> wrote:
> >
> >> I have not reproduced this problem either -- am just reading code.
> >> So, what
> >> previously I writ, and what followeth from my hand, might be, as they
> >> say in
> >> the Greek, "hogwash".
> >
> > Well, in the spirit of totally untested fixes, here's a patch that may
> > do it...
> >
> > Stefan, if you could give this a shot, I'd appreciate it.
>
> Sorry, but I still get the error "inconsistent line ending style".
> I'll try stepping through the code and see what I can find out...

Building in maintainer mode (is there an easy way to do that on
win32?) would be useful, as it could tell you the line number and file
the error is originating in, which means its easy to get a backtrace
and figure out where the error isn't getting handled...

-garrett

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


Re: Version 1.4.0: svn st errors out

Posted by Stefan Küng <to...@gmail.com>.
Garrett Rooney wrote:
> On 6/6/06, C. Michael Pilato <cm...@collab.net> wrote:
> 
>> I have not reproduced this problem either -- am just reading code.  
>> So, what
>> previously I writ, and what followeth from my hand, might be, as they 
>> say in
>> the Greek, "hogwash".
> 
> Well, in the spirit of totally untested fixes, here's a patch that may 
> do it...
> 
> Stefan, if you could give this a shot, I'd appreciate it.

Sorry, but I still get the error "inconsistent line ending style".
I'll try stepping through the code and see what I can find out...

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

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

Re: Version 1.4.0: svn st errors out

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/6/06, C. Michael Pilato <cm...@collab.net> wrote:

> I have not reproduced this problem either -- am just reading code.  So, what
> previously I writ, and what followeth from my hand, might be, as they say in
> the Greek, "hogwash".

Well, in the spirit of totally untested fixes, here's a patch that may do it...

Stefan, if you could give this a shot, I'd appreciate it.

-garrett

Re: Version 1.4.0: svn st errors out

Posted by "C. Michael Pilato" <cm...@collab.net>.
Garrett Rooney wrote:
>> The 1.4.0 version explicitly does NOT repair inconsistent line
>> endings, but
>> (unfortunately) also doesn't gracefully handle that error condition.
> 
> 
> Well, I guess the question is, what should it do in that error
> condition?  I assume its trying to translate so that it can do a
> comparison with the text base and determine if the file has changed or
> not, if we can't translate due to busted eol style do we just assume
> that the file has been modified?

Correct.

> (On a side note, where in the code is this?  The only translation code
> that looks promising is in libsvn_wc/diff.c, does libsvn_wc/status.c
> end up calling in there?  I can't actually seem to reproduce the
> actual error on a unix machine, so I can't just look at the
> maintainer-mode error to see where it came from...)

I have not reproduced this problem either -- am just reading code.  So, what
previously I writ, and what followeth from my hand, might be, as they say in
the Greek, "hogwash".

But in status.c there lives a call to svn_wc_text_modified_p, which calls
svn_wc__text_modified_internal_p, which calls compare_and_verify, which does
translation-y things (and got heavily reworked between 1.3.2 and 1.4.0).

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

Re: Version 1.4.0: svn st errors out

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/5/06, C. Michael Pilato <cm...@collab.net> wrote:
> If I'm reading the code correctly, the 1.3.2 version forces repair of
> inconsistent line endings, which is good in that it doesn't make this error
> show up, but (I'm supposing) bad in that it might keep newline-only changes
> from showing up as modifications.
>
> The 1.4.0 version explicitly does NOT repair inconsistent line endings, but
> (unfortunately) also doesn't gracefully handle that error condition.

Well, I guess the question is, what should it do in that error
condition?  I assume its trying to translate so that it can do a
comparison with the text base and determine if the file has changed or
not, if we can't translate due to busted eol style do we just assume
that the file has been modified?

(On a side note, where in the code is this?  The only translation code
that looks promising is in libsvn_wc/diff.c, does libsvn_wc/status.c
end up calling in there?  I can't actually seem to reproduce the
actual error on a unix machine, so I can't just look at the
maintainer-mode error to see where it came from...)

-garrett

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

Re: Version 1.4.0: svn st errors out

Posted by "C. Michael Pilato" <cm...@collab.net>.
If I'm reading the code correctly, the 1.3.2 version forces repair of
inconsistent line endings, which is good in that it doesn't make this error
show up, but (I'm supposing) bad in that it might keep newline-only changes
from showing up as modifications.

The 1.4.0 version explicitly does NOT repair inconsistent line endings, but
(unfortunately) also doesn't gracefully handle that error condition.

Stefan Küng wrote:
> Hi,
> 
> The following recipe produces an error when running 'svn st':
> 
> $ svnadmin create repo
> $ svn co file:///d:/test/repo wc
> now create two files with some dummy lines in them. One file must have
> CRLF lineendings, the other LF lineendings.
> $ move CRLF-File.txt wc\file.txt
> $ svn add wc\file.txt
> $ svn ci wc -m ""
> $ svn propset svn:eol-style native wc\file.txt
> $ move LF-File.txt wc\file.txt
> 
> Now, we have overwritten the file with CRLF lineendings with a file that
> has only LF lineendings. And the file has the svn:eol-style property set
> to native.
> 
> $ svn st wc
> svn: inconsistent line ending style
> 
> This happens only with an svn.exe compiled from the 1.4.x branch. The
> 1.3.x versions correctly reports:
> M      wc\file.txt
> 
> The problem with the 1.4.x behavior is (IMHO) that
> 1. It returns an error. 'svn st' should not error out if the working
> copy is not corrupt. Problems with line endings styles should either be
> reported with some status letter or be ignored in that function.
> 2. The error message is pretty much useless. Imagine you have a working
> copy folder with thousands of files in it and several subfolders: happy
> hunting the file with the "inconsistent line ending style" :)
> 
> Stefan
> 


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