Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
|Open Bugzilla tickets|
|Open Gerrit reviews|
NOTICE FOR EDITORS
This page is intentionally verbose, lengthy and detail oriented. It is not intended for advanced developers, but for QAs to be able to apply a patch available on bugzilla or elsewhere to try out things and provide feedback.
Edit this page only if you know what the previous statements mean.
This document describes the process of applying a patch to SWTBot, in order to add or change existing behavior, fix bugs etc.
What is a patch
A patch is generated using a diff program. Patches can be generated using the command line diff, or using eclipse. Eclipse has a built in diff program.
A patch is a text file that describes which particular lines were added or deleted from source files. A change to a particular line is a deletion and an addition. Here is how a patch looks in the raw format. What it actually means describes is a change that looks like this.
So what changed in that patch ?
- In the findMenus() method the boolean was changed from true to false.
- In the #doubleClick() method the click() was replaced with a lot of other methods, and a notifyTree(SWT.DefaultSelection) was added a few lines down from there.
So how do I apply the patch
While the patch file format is generally almost the same for most patches on the eclipse bugzilla, there are a few variations, based on where the diff is applied.
- Patches for the entire workspace 'workspace patch'
- Patches for a particular project/file
- Patches using git.
A workspace patch will have some metadata in it:
### Eclipse Workspace Patch 1.0 #P <project root> ... #P <another project>
The important thing is that there is a line that looks like:
diff --git a/path/to/a/file.text b/path/to/a/file.txt