[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Absolute path in patch file

From: McKenna, Simon (RGH) <Simon.McKenna_at_rgh.sa.gov.au>
Date: 2005-03-22 01:21:27 CET

Thanks for the feedback Mark and Chris, both of your
comments make sense, but was anyone able to reproduce
the problem that I had? Perhaps it's my version of
Eclipse? (3.1M5a) Anyway...here's the recipe:

- 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 segments", nothing worked,
the filename and path looked okay (which is puzzling)

So I then modified the clipboard to remove the path
from the file, in both the Index: and --- +++ sections,
redid the Apply Patch->Clipboard, hey presto, the
file's checkbox is ticked, no fiddling required.

[5 minutes later]...ah-huh!...ok...the problem was
only unresolvable if I tried to apply the patch on the
file itself...if I applied 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 applied.

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

So...it looks like a bug in Eclipse->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.

I hope this all makes some sort of sense :)

cheers
si

ps. Have logged a bug with Eclipse.

-> This seems like mostly a matter of convenience. In the
-> apply patch dialog, it is trivial to set
-> the "Ignore leading path segments" option to strip off the
-> directory up to the working copy
-> directory.
->
-> It would be ideal IMO to generate the patch relative to the
-> sandbox, but if that is not possible,
-> at least there is no real loss of functionality.
->
-> Chris.
->
-> > I took a look at that issue that Create Patch creates a
-> diff file with
-> > absolute path names. It appears that we do run svn diff
-> to create the
-> > patch, only the apply patch comes from Eclipse. The issue
-> is that svn
-> > diff outputs absolute paths in the output if you provide
-> it an absolute
-> > path name. In other words, this command would output
-> absolute path names:
-> >
-> > svn diff C:\workspace\project > d.patch
-> >
-> > There is no way that Subclipse can use relative path names
-> when we run
-> > Subversion API's, so I do not think there is anything that
-> we can do about
-> > this.
-> >
-> > Mark
Received on Tue Mar 22 11:21:27 2005

This is an archived mail posted to the Subclipse Dev mailing list.