[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: Fri, 9 Feb 2018 14:06:33 -0600

On Feb 9, 2018, at 04:44, Bo Berglund wrote:

> On Thu, 11 Jan 2018 09:51:54 -0600, Ryan Schmidt wrote:

>
>>> 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.
>
> Really? I imagine that a lot of people have been bit by this and
> someone must have come up with a way to fix the problem without having
> to manually go over all of the files in a repository matching the file
> type (by extension) and set the property.
> Is there no script or such available?

What a lot of people were bit by was the way CVS handles eol translation. When applied to files that it should not be applied to, such as binary files, eol translation is destructive and irreversible. Subversion aims to be a better CVS, so Subversion improves on CVS by requiring you to be explicit about which files you want it to perform eol translation on, so that it never performs an eol translation you didn't request.

>> 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.
>
> I have put a Readme.txt file into the repo that describes the way to
> set up the svn client side conf file.
> But it will help only for new files...

Yes.

>> 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.
>
> But this only affects files added to the repo, right?

Yes.

> I need something that can apply to *all* existing files of the
> affected types.

You need both.

>> 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.
>>
>
> This will be a hurdle since the conversion is already done and the
> repository is in use...
> But *how* would one do this if a new conversion has to be done?
> I am not fluent in Python, so any such coding is beyond me...
>
> There is one repository holding a number of projects prepared for use
> by an external contractor, which has so far not been used for
> development. So in theory I can repeat the conversion cvs2svn for this
> with some cvs2svn settings tweak that will set the svn:eol-style
> conversion correctly.
> But I need to know how this can be done in that case.
>
> Is it possible to use dump/load?
> --------------------------------
> Is it possible to somehow edit an svn dump file (with a script) to
> look for all the target files and add the eol-style property setting
> for each file so it will be effected in the svn load?
> When I look at a dumnp file load it looks like what it does is
> automatically performing all the commit operations that was done in
> the source repository....
>
> Or maybe simpler:
> -----------------
> Create dump file of the repo.
> Create a new repo and set its automatic property settings as discussed
> above.
> Then load the dump file.
> Will this make the new repository contain the automatically set eol
> properties? I.e. will the load be affected by the global repository
> automatic property settings?
>
> Note that our repos are each containing a number of "projects" in the
> top level of the repo and all of these have the structure of a svn
> repo with trunk, branches and tags subdirectories.

If you want to set the svn:eol-style property during the conversion, you'll have to read the documentation of the conversion tool or scripts you're using; I assume they would provide for this but I don't know.

If you want to do it after the conversion and fix it in all revisions by editing repository history and forcing all users to throw away their old working copies and check out new ones, then you can "svnadmin dump" the repo, then use the third-party svndumptool program to set svn:eol-style where you want it, then "svnadmin load" the modified dumpfile.

If you want to do it after the conversion by just setting the property starting now, without altering history, then check out a working copy, set the properties where you want them, then check it in.
Received on 2018-02-09 21:06:49 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.