Can I Apply a PARTIAL Patch?

Applying a partial SVN Patch using Tortoise

I see I can Apply an SVN patch, but worry that it's all or nothing.

Using Tortoise, if I select Apply Patch, then choose a file a Tortoise Merge tool opens.

Does this let me select the files I want to merge? What if there are wanted and unwanted changes in the same file?

Is there any way to revert?

What can I back up before I experiment with Applying Patches?

newbiewebSr. Software EngineerAsked:
Who is Participating?
ambienceConnect With a Mentor Commented:
Yes you can select the files that you'd like to patch and even view the differences before actually applying a patch. In this manner you can apply the same patch multiple times (one file at a time).

I dont remember whether you can selectively apply some changes to a file (been a long time) but something tells me its possible. If its not possible you can do a diff with previous version and undo unwanted changes.

A patch will only modify your working files, it wont checkin anything automatically. You can revert changes using the Revert operation (dialog that lets you select what to revert). This should be simple unless you already had modifications to your local source, in which case revert operation will discard all changes. It is better to checkin everything before applying path (if that is possible). If thats not possible you can do one of these

1- Branch and apply patch and work on the branched leg
2- Create a patch of uncommited changes say MyModifications.patch. Save it just in case you need to revert ALL. Apply the intended patch now and should you have to revert, you can revert everything and reapply your MyModifications.patch.

I prefer 2 because of simplicity and yes it works without issues.
nociConnect With a Mentor Software EngineerCommented:
Most of the time the provider of a patch test the result of the patch before releasing it.
so a partial patch may cause other problems.

btw, this is why git was built, to get rid of large patches and instead break them up in small chunks. where you can choose parts.
and also can release small parts. with each a small impact on test.
newbiewebSr. Software EngineerAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.