Can I Apply a PARTIAL Patch?

curiouswebster
curiouswebster used Ask the Experts™
on
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?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
nociSoftware Engineer
Distinguished Expert 2018
Commented:
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.
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.
curiouswebsterSoftware Engineer

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial