Creating and Applying a Patch (Subversion)
See Also
Patch files enable software developers who are not sharing a common repository
to distribute and integrate changes that have been made to the code. The IDE
enables you to create and apply patches that update copies of source files so
that you do not have to incorporate the changes manually.
To create a patch file:
- Select a versioned file (e.g., in the Projects, Files, or Favorites window)
for which you want to create a patch.
- Choose Team > (Subversion >) Export Diff Patch from the main menu. The
Export Diff Patch dialog opens.
- Select one of the following:
- Save to File. When selected, enter a name for the patch file and specify the location where
you want to save the patch.
- Attach to Issue. When selected, select the issue tracker and specify an issue ID and description.
The patch file is added as an attachment to the specified issue.
- Click OK. A patch file is created containing
the differences between the source file versions.
- Note that the Export Diff Patch command is only available on files and folders
which contain local or remote changes that have not already been merged.
To apply a patch to a local file or folder:
- Select a versioned file or folder (e.g., in the Projects, Files, or Favorites
window) on which you want to apply the patch.
- Choose Team > (Subversion >) Apply Diff Patch from the main menu. The
Apply Diff Patch dialog displays.
- In the dialog, type the path or navigate to the patch file you want to apply.
- Click Patch. The patch is applied to the selected file and a dialog opens,
confirming that the patch was applied successfully. Click Yes to view changes
in the IDE's Diff Viewer.
Notes:
- Because patches on folders use relative paths to the files within
them, folder patches must be applied on the same folder node that the
patch was created on to ensure that the patch is applied properly.
- If you are uncertain to which file or directory the patch should
be applied, you can find the context information in the patch file itself.
Patch files generated by the IDE contain the context in which the patch
was originally created in the first few lines of the file.
- See Also
- Comparing File Revisions in Subversion
- Merging File Revisions in Subversion
- Resolving Merge Conflicts in Subversion
Legal Notices