Let's suppose you are working to a set of XML files, that you distribute to other people. From time to time you are tagging the project and distribute the releases. If you continue working for a period correcting problems, you may find yourself in the situations to notify your users that you have corrected a problem. In this case you may prefer to distribute them a patch, a collection of differences that applied over the last distribution would correct the problem. The SVN client creates the patch in the Unified Diff format.
Creating patches in Subversion implies the access to two states (revisions) of a project. If you have not committed yet your current working copy and prefer not to do it, it is possible to create a patch between the current working copy and a revision from the repository. If you want to create a patch between two revisions that are already committed to the repository that is also possible.
In order to create the patch, you will use the action from the Tools menu: . This opens the Create patch wizard.
In the first step of the wizard you select the type of the patch: a patch between working copy and repository revision or a patch between two repository revisions. The Next button moves the wizard to the second step.
In case of the first type of patch in this step you specify the revision of the repository for finding the patch between the working copy and the repository. The revision can be HEAD or a revision number selected from the list of all revisions committed to the repository.
In the next step the following options can be specified:
The depth of recursive folders included in the patch. If the patch is created only for a file then the depth is always zero. The depth can have one of the values:
The depth of going into the folder for creating the patch is the same as the depth of that folder in the working copy.
The patch is created on all the files and folders contained in the selected folder.
The patch is created only on the child files and folders without going in subfolders.
The patch is created only on the child files.
The patch is created only on the selected folder (that is no child file or folder is included in the patch).
The SVN ancestry that may exist when the two URLs specified for creating the patch have a common SVN history is ignored when the patch is created.
The differences in line endings are ignored when the patch is created.
The differences in whitespaces are ignored when the patch is created.
The patch will be created and saved in clipboard.
The patch will be created and saved in the specified file.
In the next step you can specify the unversioned files that will be included in the generated patch. If the patch is applied on a folder of the working copy and that folder contains unversioned files this step of the wizard offers the option of selecting the ones that will be included in the patch.