Community
Participate
Working Groups
Build ID: I20080617-2000 Steps To Reproduce: 1. Create a file in an SVN managed project with some text but no newline at the end (or remove the newline on the end of an existing file). 2. Create a patch for the project. 3. Revert changes to the project. 4. Apply the patch to the project. 5. Look at the new (or modified) file. Notice that it ends with "\ No newline at end of file". More information: An SVN patch for a file that does not end with a newline includes the special marker "\ No newline at end of file". This marker should not actually be inserted in the file. You can distinguish the marker from the literal text in the patch (if for some reason a file was supposed to actually say that at the end) by the presence or absence of an actual newline. My current workaround is to use a different SVN client to apply the patches (TortoiseSVN, specifically). Prior to that I would perform a search-and-replace over the entire project.
We have a similar problem with some of our projects. The problem seems to be with creating the patch in the first place (because the newline before "\ No newline..." is missing from the patch). Bernd, which version of Subversive are you using? BTW, this works fine for me using the Subversive client (team stuff 0.7.3.i20080814 and the connectors 2.0.3.i20080814) that came with Zend Studio for Eclipse 6.1.0 for Linux.
(In reply to comment #0) > Build ID: I20080617-2000 > > Steps To Reproduce: > 1. Create a file in an SVN managed project with some text but no newline at the > end (or remove the newline on the end of an existing file). > 2. Create a patch for the project. > 3. Revert changes to the project. > 4. Apply the patch to the project. > 5. Look at the new (or modified) file. Notice that it ends with "\ No newline > at end of file". Is the created patch ok, or does the patch allready have the mistake with the newline? Can you post the patch which is involved in this problem?
Created attachment 120320 [details] An example patch with the "No newline" at the end
The patch is created correctly (and can be applied with TortoiseSVN correctly). The problem is that Subversive does not apply it correctly.
(In reply to comment #4) > The patch is created correctly (and can be applied with TortoiseSVN correctly). It looks like the patch is the problem, because regular patches with files which have no newline at the end look like this: +?> \ No newline at end of file Your patch looks like this: +}\ No newline at end of file Which should be the problem. Because in my understanding of patches there needs to be a newline before the \No newline at end of file statement.
I just created a patch with TortoiseSVN and I see that it agrees with you. The example patch I attached was created with Subversive, so I guess the real problem is that Subversive is creating the patch incorrectly.
To complete the picture: I'am using: Eclipse with PDT 1.0.3.v20080603 Subversive SVN Team Provider: 0.7.5.I20081029-1900 Connectors: 2.0.6.I20081205-1900
I'm running Eclipse JEE 3.4.0.I20080617-2000 Subversive SVN Team Provider: 0.7.3.I20080814-1500 Connectors: 2.0.3.I20080814-1500
I just updated to the latest (same Team versions as Bernd) and still see this problem when creating a patch.
By the way, this is the version which I'm using which does *not* exhibit this problem: Zend Studiod for Eclipse 6.1.0 (based on Eclipse 3.4.0) SVN Team Provider (incubation) 0.7.3.i20080814-1500 Subversive SVN Kit Connector 1.4 2.0.3.i20080814-1500 Subversive SVN Kit Connector 1.5 2.0.3.i20080814-1500 Subversive SVN Kit Connectors 2.0.3.i20080814-1500
It may be a special case. I created a patch on a very large change and see that the "No newline" marker is placed properly on changing files, but not on new files.
Hilton, I don't have the permission to edit this bug's summary. Could you edit it to better reflect the problem (creating the patch)?
Fixed
Here is a workaround for those who don't have the possibility to apply the patch: 1. add the new file to verion control: - Right Mouse Button -> Team -> Add to version control... 2. create the patch. This fixes this issue.