[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Inconsistent line ending style terminates add without message

From: johnea <me_at_johnea.net>
Date: Tue, 20 Oct 2009 11:28:32 -0700

Thank you Ryan and David for your guidance.

On 10/19/09 21:19, Ryan Schmidt wrote:
> On Oct 19, 2009, at 21:07, David Weintraub wrote:
>
>> On Sun, Oct 18, 2009 at 12:13 PM, johnea <me_at_johnea.net> wrote:
snip...snip...
>
> This sounds different from but perhaps related to issue 2713, which
> was fixed; the fix will be in Subversion 1.7.0.
>
> http://subversion.tigris.org/issues/show_bug.cgi?id=2713
>
> johnea could try building Subversion from trunk to see if the behavior
> can still be reproduced.
>

I have built an archlinux package for the Revision: 40122 of the
https://svn.collab.net/repos/svn/trunk source tree.

I ran the procedure for reproduction listed in issue 2713 from the link
above. The only addition to this procedure was to copy the mixed.php
to mixed.c, since my config didn't list php files for eol-style:native
but it did list *.c files.

First with my installed subversion 1.6.5-5 package yielding:

[johnea_at_vhost svntest]$ svn add wc/*
svn: File 'wc/mixed.c' has inconsistent newlines
svn: Inconsistent line ending style
[johnea_at_vhost svntest]$ svn status wc
? wc/mixed.php
? wc/nothing.php
A wc/mixed.c

This shows the mixed.php and nothing.php files that share the directory
with the mixed.c as not being added.

Secondly with the svn build of rev 40122 yielding:

[johnea_at_vhost svntest]$ svn co file://`pwd`/repo wc
Checked out revision 0.
[johnea_at_vhost svntest]$ perl -e 'print "foo\nbar\r\nbaz\n";' > wc/mixed.php
[johnea_at_vhost svntest]$ touch wc/nothing.php
[johnea_at_vhost svntest]$ cp wc/mixed.php wc/mixed.c
[johnea_at_vhost svntest]$ svn add wc/*
svn: File '/home/johnea/src/svntest/wc/mixed.c' has inconsistent newlines
svn: Inconsistent line ending style
[johnea_at_vhost svntest]$ svn status wc/*
? wc/mixed.c
? wc/mixed.php
? wc/nothing.php

Which complies with what is discussed at the bottom of issue 2713, i.e.
the add is reverted before abort, causing all files to not be added.

However There is still an issue. Illustrated by another test.

Thirdly with svn rev 40122 build with nested subdirectories:

[johnea_at_vhost svntest]$ svn co file://`pwd`/repo wctop
Checked out revision 0.
[johnea_at_vhost svntest]$ mkdir wctop/wcsub-mixed
[johnea_at_vhost svntest]$ mkdir wctop/wcsub-OK
[johnea_at_vhost svntest]$ mkdir wctop/wcsub-notmixed
[johnea_at_vhost svntest]$ perl -e 'print "foo\nbar\r\nbaz\n";' > wctop/wcsub-mixed/mixed.php
[johnea_at_vhost svntest]$ perl -e 'print "foo\nbar\r\nbaz\n";' > wctop/wcsub-mixed/mixed.c
[johnea_at_vhost svntest]$ touch wctop/wcsub-mixed/nothing-in-mixed.c
[johnea_at_vhost svntest]$ touch wctop/wcsub-OK/nothing-in-OK.c
[johnea_at_vhost svntest]$ touch wctop/wcsub-notmixed/nothing-in-notmixed.c
[johnea_at_vhost svntest]$ svn add wctop/*
A wctop/wcsub-OK
A wctop/wcsub-OK/nothing-in-OK.c
A wctop/wcsub-mixed
A wctop/wcsub-mixed/nothing-in-mixed.c
A wctop/wcsub-mixed/mixed.php
svn: File '/home/johnea/src/svntest/wctop/wcsub-mixed/mixed.c' has inconsistent newlines
svn: Inconsistent line ending style
[johnea_at_vhost svntest]$ svn st wctop/*
A wctop/wcsub-OK
A wctop/wcsub-OK/nothing-in-OK.c
A wctop/wcsub-mixed
A wctop/wcsub-mixed/nothing-in-mixed.c
? wctop/wcsub-mixed/mixed.c
A wctop/wcsub-mixed/mixed.php
? wctop/wcsub-notmixed

This illustrates that subdirectories which are alphabetically ordered
prior to the name of the mixed line ending style directory are added.
While the directory containing the mixed ending file only fails to add
the offending file and adds the other files. The directory with a name
that comes after the offending directory is not added.

A commit after this add operation will still place only part of the
source tree in the repository. However I would consider it to still be
an improvement. The add does abort at the offending file, leaving the
"inconsistent line ending" message at the bottom of the output,
instead of scrolling it away in the ongoing list of added files.

The user is therefore able to address this issue on a file by file basis
as the add failures are reported.

Another add after fixing the offending file completes the operation:

[johnea_at_vhost svntest]$ gvim wctop/wcsub-mixed/mixed.c
    (fix the line ends and save)
[johnea_at_vhost svntest]$ svn add wctop/*
svn: warning: '/home/johnea/src/svntest/wctop/wcsub-OK' is already under version control
svn: warning: '/home/johnea/src/svntest/wctop/wcsub-mixed' is already under version control
A wctop/wcsub-notmixed
A wctop/wcsub-notmixed/nothing-in-notmixed.c

The subsequent commit now contains all files:

[johnea_at_vhost svntest]$ svn ci wctop -m "Do all of the files commit?"
Adding wctop/wcsub-OK
Adding wctop/wcsub-OK/nothing-in-OK.c
Adding wctop/wcsub-mixed
Adding wctop/wcsub-mixed/mixed.php
Adding wctop/wcsub-mixed/nothing-in-mixed.c
Adding wctop/wcsub-notmixed
Adding wctop/wcsub-notmixed/nothing-in-notmixed.c
Transmitting file data ....
Committed revision 1.

In conclusion, it seems the behavior of this new fix differs between files
in the root of the wc and files in subdirectories, however the termination
of the add operation on encountering eol issues does at least allow the
user to correct each of these before leaving things out of the subsequent
commit without the users knowledge.

Thank you again for your replies...

johnea

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2409492

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-10-20 20:30:14 CEST

This is an archived mail posted to the Subversion Users mailing list.