You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by David Kramer <da...@thekramers.net> on 2005/02/08 17:29:09 UTC

"Inconsistent newlines": A clue

I'm trying to svn import a big mess o files.  We have the autoprops 
eol-style native set (see previous message).

When I do the import, I get that message on some of the files, then it 
dies.  This is REALLY bad behavior in my eyes, because each try takes over 
20 minutes, and I have not found a reliable mechanism for identifying 
files it will barf on.  I would much rather it warn about that file and 
move on.  Why does it care anyway?

So I'm using od (octal dump) to look at some of the files, and having 
trouble finding the offending lines.  Then I noticed that one of the files 
has a literal \r in it.  Could the import code be flawed in that it sees a 
literal \r and flags that as a problem?

Here's the line:
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"


--
DDDD   David Kramer         david@thekramers.net       http://thekramers.net
DK KD
DKK D  Buckle up for safety!
DK KD  It makes it harder for the aliens to suck you out of your car.
DDDD   

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

Re: "Inconsistent newlines": A clue

Posted by Ben Collins-Sussman <su...@collab.net>.
On Feb 9, 2005, at 12:09 PM, David Kramer wrote:

> How does one add something to contrib, once written?
>

Mail a patch to the dev@ list!  See the HACKING file to learn about 
submission procedures.


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

Re: "Inconsistent newlines": A clue

Posted by Michael W Thelen <mi...@pietdepsi.com>.
David Kramer wrote:
>>>It would be more user-friendly to report *all* the problem files after
>>>a single run.  This might be complex to implement, but it's certainly
>>>possible, and I wouldn't be averse to an enhancement issue being filed
>>>about it.  What do you think?
>>>
>>
>>I'm not sure I understand the proposal.  One runs 'svn import', and
>>then 20 minutes in, you see a message like
>>
>>   svn: file X has inconsistent newlines
>>   svn: this commit will fail, but continuing to search for other such
>>files...
>>
>>?
>>
>>Perhaps a better solution is a tool to go into contrib/ which will scan
>>a directory for files with this problem.  It can be used as a
>>"pre-flight" check before large imports.
>>
>
>
> Yes, that's an excellent suggestion.
>
> And perhaps I should be the one to write it.  I just found out Monday my
> contract is being terminated, so I should have hte time ;)

It may or may not be exactly what you want, but I wrote a script a few
months ago that automatically sets properties as listed in the
auto-props section of your config file.  It's useful if you have checked
in a bunch of files without using auto-props, and want to set properties
as if you had used auto-props.  It also detects inconsistent newlines
and can try to fix them (that may only work on Linux, I haven't had time
to test it on Windows).  In your case, maybe you could simply turn off
auto-props, import your files, then run this script.

The latest version of the script lives here:
http://svn.pietdepsi.com/repos/projects/svn-tools/set-props.pl

I also posted a version to the dev@ mailing list here:
http://svn.haxx.se/dev/archive-2004-07/0866.shtml

and Ben Reser said he would commit it here:
http://svn.haxx.se/dev/archive-2004-09/0038.shtml

but it was probably simply forgotten.  I hope you find it useful!

--
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams

Re: "Inconsistent newlines": A clue

Posted by David Kramer <da...@thekramers.net>.
On Tue, 8 Feb 2005, Ben Collins-Sussman wrote:

> > It would be more user-friendly to report *all* the problem files after
> > a single run.  This might be complex to implement, but it's certainly
> > possible, and I wouldn't be averse to an enhancement issue being filed
> > about it.  What do you think?
> >
> 
> I'm not sure I understand the proposal.  One runs 'svn import', and 
> then 20 minutes in, you see a message like
> 
>    svn: file X has inconsistent newlines
>    svn: this commit will fail, but continuing to search for other such 
> files...
> 
> ?
> 
> Perhaps a better solution is a tool to go into contrib/ which will scan 
> a directory for files with this problem.  It can be used as a 
> "pre-flight" check before large imports.
> 

Yes, that's an excellent suggestion.

And perhaps I should be the one to write it.  I just found out Monday my 
contract is being terminated, so I should have hte time ;)

I see that a fair number of contrib programs are done in Perl, so I'll us 
e that.  

How does one add something to contrib, once written?

----------------------------------------------------------------------------
DDDD   David Kramer         david@thekramers.net       http://thekramers.net
DK KD  
DKK D  "You can build a throne out of bayonets,
DK KD  but you can't sit on it for very long.
DDDD                                                         - Boris Yeltsin

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

Re: "Inconsistent newlines": A clue

Posted by Ben Collins-Sussman <su...@collab.net>.
On Feb 8, 2005, at 4:03 PM, kfogel@collab.net wrote:

> Ben Collins-Sussman <su...@collab.net> writes:
>> If you set 'svn:eol-style = native' on a file (which you're probably
>> doing with auto-props), and then try to commit the file, svn will barf
>> if it discovers inconsistent line endings.
>>
>> Why?  Because if it converted the line endings to all LF or all CRLF,
>> the conversion would be lossy.  There's no way to get the original
>> file back.  Subversion refuses to lose data.  Therefore, it barfs and
>> demands that you fix the inconsistent line endings yourself.
>>
>> Be thankful that it's doing this, not angry.
>
> I think his objection is that it gets 20 minutes into the import, then
> dies on one file, and after you fix that file, maybe it will go 40
> minutes, then die on another file, and so on.
>
> It would be more user-friendly to report *all* the problem files after
> a single run.  This might be complex to implement, but it's certainly
> possible, and I wouldn't be averse to an enhancement issue being filed
> about it.  What do you think?
>

I'm not sure I understand the proposal.  One runs 'svn import', and 
then 20 minutes in, you see a message like

   svn: file X has inconsistent newlines
   svn: this commit will fail, but continuing to search for other such 
files...

?

Perhaps a better solution is a tool to go into contrib/ which will scan 
a directory for files with this problem.  It can be used as a 
"pre-flight" check before large imports.


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

Re: "Inconsistent newlines": A clue

Posted by kf...@collab.net.
Ben Collins-Sussman <su...@collab.net> writes:
> If you set 'svn:eol-style = native' on a file (which you're probably
> doing with auto-props), and then try to commit the file, svn will barf
> if it discovers inconsistent line endings.
> 
> Why?  Because if it converted the line endings to all LF or all CRLF,
> the conversion would be lossy.  There's no way to get the original
> file back.  Subversion refuses to lose data.  Therefore, it barfs and
> demands that you fix the inconsistent line endings yourself.
> 
> Be thankful that it's doing this, not angry.

I think his objection is that it gets 20 minutes into the import, then
dies on one file, and after you fix that file, maybe it will go 40
minutes, then die on another file, and so on.

It would be more user-friendly to report *all* the problem files after
a single run.  This might be complex to implement, but it's certainly
possible, and I wouldn't be averse to an enhancement issue being filed
about it.  What do you think?

-Karl

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

Re: "Inconsistent newlines": A clue

Posted by Ben Collins-Sussman <su...@collab.net>.
On Feb 8, 2005, at 11:29 AM, David Kramer wrote:

> I'm trying to svn import a big mess o files.  We have the autoprops
> eol-style native set (see previous message).
>
> When I do the import, I get that message on some of the files, then it
> dies.  This is REALLY bad behavior in my eyes, because each try takes 
> over
> 20 minutes, and I have not found a reliable mechanism for identifying
> files it will barf on.  I would much rather it warn about that file and
> move on.  Why does it care anyway?

If you set 'svn:eol-style = native' on a file (which you're probably 
doing with auto-props), and then try to commit the file, svn will barf 
if it discovers inconsistent line endings.

Why?  Because if it converted the line endings to all LF or all CRLF, 
the conversion would be lossy.  There's no way to get the original file 
back.  Subversion refuses to lose data.  Therefore, it barfs and 
demands that you fix the inconsistent line endings yourself.

Be thankful that it's doing this, not angry.


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

RE: "Inconsistent newlines": A clue

Posted by Dale Worley <dw...@pingtel.com>.
-----Original Message-----
From: David Kramer [mailto:david@thekramers.net]

When I do the import, I get that message on some of the files, then it
dies.  This is REALLY bad behavior in my eyes, because each try takes over
20 minutes, and I have not found a reliable mechanism for identifying
files it will barf on.  I would much rather it warn about that file and
move on.  Why does it care anyway?
---------------------------------------------------------------------

Well, it *has* to object, because in any file with svn:eol-style set, the
EOL characters in the repository are only symbolic of "end of line".  If you
attempt to check in a file that violates this model, it *must* fail.  And
since you're doing an import, all the checkins together *must* be atomic.

I'd try using "svn add" and seeing what happens.  Or if the problem is
really bad, do "svn add" *without* svn:eol-style, then propset it on one
file at a time, then check in the directories and files one at a time
non-recursively.

Dale


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