Overview #

This article will walk you through applying a patch using TortoiseSVN.

What You Will Need Before Starting #

Top ↑

Applying a Patch With TortoiseSVN #

Top ↑

1. Downloading a Patch #

Part of the troubleshooting/testing process involves downloading and applying patches to your local WordPress trunk install from a Trac ticket that you are involved in.

To download a patch, right-click on the filename in the Attachments section of the ticket (just below the Description section), select Save Link As in the context menu, and save it to a folder called patches.

Download A Patch From Trac Ticket Screen

Top ↑

2. Applying A Patch #

To apply the patch you just downloaded, right-click in the folder for your working copy of WordPress, which will bring up a context menu. Click on SVN Apply Patch.

TortoiseSVN Apply Patch Context Menu Screen

This will bring up a file open dialog window, allowing you to select the patch file to apply. By default, only .patch or .diff files are shown, but you can change the file type to All files if you don’t see the patch file you are looking for.

TortoiseSVN Select Local File Screen

Applying a patch file to your working copy of WordPress should be done at the same folder level as was used to create the patch. If you are in the correct working copy, but picked the wrong folder level, TortoiseSVN will display a notice, suggesting the correct level, and allows you to select that.

TortoiseSVN Wrong Directory Screen

Once you have selected the patch file and correct working copy location, TortoiseMerge will run to merge the changes from the patch file with your working copy. A small window lists the files which have been changed. Double-click each filename, review the changes, and save the patched file to your working copy.

TortoiseSVN File Patched Screen

Top ↑

Next Steps #

  • Testing A Patch