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

Re: EOL problems in cvs2svn converted repository

From: Ryan Schmidt <subversion-2018_at_ryandesign.com>
Date: Thu, 11 Jan 2018 09:51:54 -0600

On Jan 11, 2018, at 05:43, Bo Berglund wrote:

> I have converted our CVS repositories to SVN using cvs2svn.py v 2.5.0.
> It looked like it was successful but now when I am working in the
> checked out code I noticed that the line endings are UNIX style even
> when checking out on Windows (our main working platform).
> With CVS we always got a conversion from UNIX LF (in the repository)
> to Windows CRLF in the working copy.
> Not so now...
>
> I have read the SVNBook 1.7 about EOL sequences but I do not
> understand what I can do to fix this.
> It will not be possible to go through every text file in the
> repository and change its "properties" because we store such an
> immense number of files in our repositories.
> Is there any way to tell the svn client to set line endings to Windows
> style when checking out on Windows (similar to the timestamp option I
> asked about recently)? And return to repository style on commit...
>
> I found a section in the conf file named [auto-props] but it seems
> only to be applicable for commit and import, not for checkout AFAICT.
> And all of that section is commented out by default.

If you want Subversion to perform EOL translation on a file, you must set the svn:eol-style property on that file to the desired value. There is no other way.

If you want all files with a particular name or extension to get this property when they are added to a working copy, set that up in the auto-props section of your Subversion client's file. This will apply to that client only and would need to be repeated for all clients / all users.

If using Subversion client 1.8 or later, use a repository-dictated auto-props configuration:

https://subversion.apache.org/docs/release-notes/1.8.html#repos-dictated-config

Auto-props only cause the property to be added to the file when the file is added to the working copy. A user can subvert auto-props, and a user can also delete the property after it was added, before or after the file was committed.

If you want to enforce that this property is used on files that need it, and/or prevent users from removing it, write a pre-commit hook that does that.

If you want all of the files you're importing from CVS that match the criteria to have the property, adjust your cvs-to-svn conversion process to arrange for that to be the case.
Received on 2018-01-11 16:52:11 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.