Bug 88707 - [Patch] SVN patches have problem when applying on a single file
Summary: [Patch] SVN patches have problem when applying on a single file
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 minor with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-03-21 19:20 EST by si CLA
Modified: 2021-12-24 20:13 EST (History)
3 users (show)

See Also:


Attachments
Original file (before amending) (482 bytes, text/html)
2005-03-23 00:08 EST, si CLA
no flags Details
Patch to apply on about.html (692 bytes, patch)
2005-03-23 00:13 EST, si CLA
no flags Details | Diff
Sample SVN Patch (41.22 KB, patch)
2006-05-23 16:13 EDT, Mark Phippard CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description si CLA 2005-03-21 19:20:52 EST
Subversion Subclipse plugin produces patch files with absolute paths.  If you
try and apply a patch on a single file, "Apply Patch" will not let you, you have
to select the directory of the file.

Recipe (must be patch file with absolute path, relative pathes work fine)

- Modify a file from a working copy
- Team->Create Patch->Save to clipboard
- Revert file
- Team->Apply Patch->Clipboard->Next

At this point the "Verify Patch" dialog appears, there's an exclamation mark
next to the file, with an error message: file does not exist.

I tried all the path options, including setting the "Ignore leading path name
segements", nothing worked, the filename and path looked okay (which is puzzling)

If I apply the patch on the directory of the modified file (or higher), then I
could set the dropdown "Path Options->Ignore leading path name segments" to the
largest value, and the patch was successfully applied.

This worked if I selected the directory of the file from either the Navigator
view, or from within the directory tree in the first "Apply Patch" dialog.

It looks like a bug in "Apply Patch", but it would only appear with absolute
paths, normal CVS operations wouldn't be affected, hence it would be
restricted to SVN users, and only those who apply patches on individual files,
rather than directories.
Comment 1 Michael Valenta CLA 2005-03-22 08:25:35 EST
Apply Patch is provided by the Compare component.
Comment 2 Andre Weinand CLA 2005-03-22 08:57:34 EST
Could you please attach an example SVN patch file and an original file (to apply the patch against).
Thanks.
Comment 3 si CLA 2005-03-23 00:08:18 EST
Created attachment 19104 [details]
Original file (before amending)

Clean copy of file before patch is applied
Comment 4 si CLA 2005-03-23 00:13:47 EST
Created attachment 19105 [details]
Patch to apply on about.html

"Apply Patch" fails when selecting the individual file from Navigator or apply
patch dialog, but works when selecting the directory containing the file.

Note the absolute path used by Subclipse (svn diff outside of working copy).
Relative paths (eg. CVS diff or svn dff inside working copy) work as expected.
Comment 5 Mark Phippard CLA 2006-05-23 16:13:23 EDT
Created attachment 42318 [details]
Sample SVN Patch

This problem appears to have gotten worse in recent 3.2 builds.  When SVN patches contain new files, the Apply Patch is not letting you apply them.  I assume this has something to do with the SVN Unified Diff format.  Subclipse patches always have absolute path names because when we run the svn diff library code, the current working directory is not set to your project folder as it typically would be when you run the svn command line.

This could be a very significant problem for SVN and Eclipse 3.2.

I am using RC5 downloaded today.  I am attaching the patch I am trying to apply so you can see the format.  It is similar to Andre's.
Comment 6 Eugene Kuleshov CLA 2006-05-23 18:29:35 EDT
I support Mark on this. I've been hitting into this issue from time to time and now it somethow got worse.
Comment 7 Mark Phippard CLA 2006-05-23 18:47:43 EDT
Entered a new issue as it is really not the same as this one:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=143354
Comment 8 Michael Valenta CLA 2006-12-11 12:27:49 EST
We do not have the manpower to address this issue in 3.3.
Comment 9 Martin Oberhuber CLA 2008-02-28 14:38:46 EST
Now that we have Subversive as a project, should that be moved to Technology / Subversive?
Comment 10 Mark Phippard CLA 2008-06-07 13:01:31 EDT
With latest version of Subclipse (1.4.x) we are now able to create patches using relative paths (also workspace-relative for multiple project patches).  This issue can probably be closed. 
Comment 11 Eclipse Webmaster CLA 2019-09-06 15:35:13 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 12 Eclipse Genie CLA 2021-12-24 20:13:45 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.