Bug 183233 - [Apply Patch] Return hunks from IFilePatch
Summary: [Apply Patch] Return hunks from IFilePatch
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.3   Edit
Hardware: Other Linux
: P3 enhancement (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Pawel Pogorzelski CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-04-19 13:45 EDT by Stefan Xenos CLA
Modified: 2009-02-16 09:08 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Xenos CLA 2007-04-19 13:45:10 EDT
Right now, the only way I can determine the IHunks in an IFilePatch is by attempting to apply it to a file and checking the IFilePatchResult. However, this only returns the unsuccessful patches.

I'd like to be able to create a preview window that tells the user what's in a patch before they try to apply it.

I'd like something like this on IFilePatch:

/**
 * Returns the hunks in this patch
 */
IHunk[] getHunks();
Comment 1 Tomasz Zarna CLA 2007-12-10 11:01:57 EST
Stefan, please take a look at bug 190418 and the patch attached to it. Do you think it will be useful for you?
Comment 2 Stefan Xenos CLA 2007-12-11 22:21:07 EST
I took a look at bug 190418, but did not see any new API on IFilePatch.

The idea of an Eclipse-provided patch viewer/editor sounds good, but it won't solve my problem. I'll still need the new API, even if Eclipse provides a patch viewer.
Comment 3 Tomasz Zarna CLA 2007-12-12 04:43:47 EST
I'm sorry, I should have made myself clearer instead of just point to the other bug. In comment 0, you said that your intention is to "create a preview window that tells the user what's in a patch". This is exactly what the outline view from bug 190418 is supposed to do... without using any new API. However, I do realize that a viewer-thing of this kind is not what you would like to have or at least doesn't meet all your needs.
Comment 4 Stefan Xenos CLA 2007-12-13 08:28:00 EST
> viewer-thing of this kind is not what you would like to have

Oh, I think the idea of the viewer-thing is lovely. However, my app has its own patch format with various extensions that also need to be visualized, and since we already have our own patch viewer, we wouldn't be using the one from bug 190418.

My interest here is mainly in simplifying the code for my current patch viewer (which needs to do some complicated things to obtain the hunks).
Comment 5 Szymon Brandys CLA 2008-04-15 09:18:43 EDT
Since it involves API changes, it will not be fixed for 3.4. Reassigning to 3.5 for further investigation.
Comment 6 Pawel Pogorzelski CLA 2009-02-16 09:08:37 EST
This bug has been fixed along with bug 183238.