Community
Participate
Working Groups
Created attachment 86834 [details] patch to fix inconsistent line endings The using Advanced Fix Copyright on Windows with Subversion it's impossible to commit any touched files afterwards because of inconsistent line endings in the file. I found the problem in the "empty lines" which will print out a hard coded '\n' instead of the current system line ending. The attached patch fixes the problem.
Note, the patch also sets the adaptable="true" flag in plugin.xml to make the action appear in other views too.
Created attachment 89116 [details] patch to fix inconsistent line endings plus support for xml files This is a second version of the patch which also adds support for XML files.
Is this a dup of bug 140936?
Bumping severity. The XML files with corrupted line delimiters cause CHKPII errors.
See also bug 215224.
(In reply to comment #5) > See also bug 215224. See also bug 276257.
This is a critical bug as it mangles the files.
Is this for subversion only? Sorry I've not noticed it earlier. And hate to ask you to do more work ... but .... any chance this was fixed by changes made for bug 345669? Tomasz, since you've been in this code lately, can you please assess?
(In reply to comment #8) > And hate to ask you to do more work ... but .... any chance this was fixed by > changes made for bug 345669? Sorry, not a chance, a CopyrightAdapter is used only for retrieving last modified year for a file. There is no code for updating the file in the adapter. It's done in the SourceFile [1] class. > Tomasz, since you've been in this code lately, can you please assess? I'll try to look at it if I get some free cycles. If I understood the result of bug 276257 support for fixing copyrights in XML files has been disabled. [1] org.eclipse.releng.tools.SourceFile.replace(BlockComment, String)
Sorry, I won't have time to look at it in the nearest future. I'm returning the bug to inbox to make the situation clear.
The tool still messes up the line delimiters, especially in cases where the copyright is newly inserted. Both attached patches won't help, because they use println(), which inserts the line delimiter on which the tool is run, instead of the line delimiter that is currently used in the file. I'll fix the line delimiter issue and opened new bug 381147 for the missing XML support.
Created attachment 216562 [details] Fix
Note: this does *not* fix line delimiter issues for XML files. This is treated in bug 276257.
Fixed in master: http://git.eclipse.org/c/platform/eclipse.platform.releng.git/commit/?id=040eaa4b95d6e70a44c5820d55f865c57a02229d