Community
Participate
Working Groups
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();
Stefan, please take a look at bug 190418 and the patch attached to it. Do you think it will be useful for you?
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.
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.
> 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).
Since it involves API changes, it will not be fixed for 3.4. Reassigning to 3.5 for further investigation.
This bug has been fixed along with bug 183238.