How can I fix the SVN import line endings error?

前端 未结 9 1832
名媛妹妹
名媛妹妹 2021-02-05 22:25

I have to import an huge SVN repository that I have to transfer from one server to another. So I exported it from the old server:

svnadmin dump . > archive.sv         


        
9条回答
  •  执笔经年
    2021-02-05 22:36

    I ran into this error when upgrading a 1.6 repo to 1.8. I found a number of "Fixes" on the net.

    The --bypass-prop-validation did not appeal to me because it postpones the problem, the next time you need to restore the repo you will hit the same promblem.

    I found a bash script to loop through the revisions getting the comments and setting them again but this did not work.

    An improvement on ventura10's solution did the job. Because of the size of the dump I ended up using the single command to remove the unwanted characters while restoring the dump

        sed -e '/^svn:log$/,/^K / s/^M/ /' -e '/^svn:ignore$/,/^PROPS-END$/ s/^M/\n/' /path/to/svn.dump | svnadmin load /path/to/repo
    

    NOTE:

    Where ^M is a control character, that means 0D in hex. To get it use ^V^M (control V control M) instead ^M (circumflex M or control M)

提交回复
热议问题