My typical work process is like:
- Check out the codes from trunk on to my windows work machine
- Do some fixes (but no commit the SVN) and create a patch of these modifications using Tortoise SVN's "Create Patch".
- SSH log into a remote Linux server, and upload the patch. The linux server also has the trunk HEAD checked out.
- Apply the patch on the Linux Server like:
[work@remoteLinuxBox:~/work] patch -p0 -i ~/work/fix.patch (Stripping trailing CRs from patch.) patching file src/java/main/myApp/view/action/test/launch/GetPeekAction.java Hunk #1 FAILED at 385. 1 out of 1 hunk FAILED -- saving rejects to file src/java/main/myApp/view/action/test/launch/GetPeekAction.java.rej (Stripping trailing CRs from patch.) patching file src/java/main/myApp/view/action/test/GetAllCustomerAction.java Hunk #1 FAILED at 76. 1 out of 1 hunk FAILED -- saving rejects to file src/java/main/myApp/view/action/test/GetAllCustomerAction.java.rej (Stripping trailing CRs from patch.)
But I always got errors like these. I thought it was caused by the reason that the end of the line is different on windows and Linux, so I converted the patch using dos2unix, the warning like (Stripping trailing CRs from patch) disappeared, but the patching still failed.
There is one strange behavior that if the modification for a file only happens on a existing line, applying patch will work. But if there are new lines added, the patch gets failed.
Anyone has clue on how to resolve this? Thanks very much