Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Apply patch in Sync view"
m (→Synchronize wizard) |
m (→Synchronize participant, subscriber) |
||
Line 31: | Line 31: | ||
* Pinnable | * Pinnable | ||
* Listen to workspace changes, reapply all hunks for a file when needed using the patch options already set | * Listen to workspace changes, reapply all hunks for a file when needed using the patch options already set | ||
+ | * [[Image:Progress.gif]] bug: Applying changes should remove it from the sync view - be in sync | ||
==Synchronize wizard== | ==Synchronize wizard== |
Revision as of 11:58, 3 December 2009
Contents
Problem
Provide an alternative way of applying patches. Desired behavior, which could in future replace the current one, is to use the Synchronize View to display content of a patch, resolve potential conflicts and apply the patch eventually. This way while the comparison is being done, other features of Eclipse are available to use, we are not bounded to the current Apply Patch wizard.
This is tracked by bug 236169.
Solution
The proposed solution consist of several parts:
- Subscriber -
- SyncInfo -
- IResourceVariant -
- ModelProvider -
- model objects -
- ResourceMappings -
- org.eclipse.team.ui.synchronizeWizards extension point -
- org.eclipse.team.ui.synchronizeParticipants extension point -
- org.eclipse.ui.navigator.navigatorContent extension point -
- content providers -
- label providers -
- org.eclipse.core.runtime.adapters -
Tasks
Required changes are grouped in the following areas:
Synchronize participant, subscriber
- Add synchronize participant + subscriber
- IResourceVariant implementation should return patched files when asked for Storage
- Persistable, intitialized on startup; remember which hunks have been applied; remember patch options set
- Pinnable
- Listen to workspace changes, reapply all hunks for a file when needed using the patch options already set
- bug: Applying changes should remove it from the sync view - be in sync
Synchronize wizard
- Embed apply patch wizard into synchronize wizard so patch (input) can be selected
- Add a page to the new wizard where user can select how the patch should be applied (traditionally, preview in the wizard or in Sync view)
- Provide a proper icon for the participant
- Provide valid description for the participant
Model Provider
- Model objects for hunks
- Don't block other model providers to participate in synchronization (applying patch)
- Other model providers do not display hunks
-
Use DiffProject, FilePatch2 and Hunk as model objects - Use PatchDiffNodes as model objects, they represent the result of applying a patch (not the patch strucutre as types above) and they implement ICompareInput so are compare-ready
- Missing objects representing folders, the result is something like flat presentation
Sync view
- Status line should display lines added/removed by the patch
- NPE when trying to switch to a different synchronization when applying patch (see bug 256972)
Content provider
Label provider
- Display Patch options settings: fuzz factor, offset used (bug 205762), moved from(?)
- Use conflict ('double-headed red arrow') icon instead of 'red X' icon for unmatched hunks
- Update means now 'Apply'
- 'Apply' should work for projects, files and individual hunks
- 'Apply' should be disabled for unmatched hunks
- 'Apply' on file/project containing unmatched hunks should affect matched hunks only
- Do we need two 'Apply' variants: merge and overwrite-and-update?
- Add 'Open'/'Open With' actions
- Add 'Open in Compare' action
- 'Remove from View' means now 'Exclude'
- No 'Exclude' action available, replaced with 'Remove from the view'
View toolbar
- 'Copy All Incoming Changes...' means 'Apply All'
- Only 'Incoming' and 'Conflicts' mode should be available
- 'Flat presentation' is meaningless for Patch Model (see also bug 277107)
Operations
Patch options
- Re-applying patch -> synchronize again
- Remember set options when re-applying: fuzz factor, ignored segments, moved hunks
- Ignore segments setting applies to all files in the patch -> re-apply
- Reverse patch on sync's view toolbar(?)
- Show matched Hunks: All hunks are shown
- Show excluded Hunks -> Sync's view drop down > Restore Removed Items
- Fuzz factor / Guess
- Generate .rej files for unmerged hunks - applies to all changes from the patch
- Move hunk
Source code
No source code is available yet, the plan is to commit to a public branch soon. Or at least submit a dirty patch on the bug 236169.