How to use Patch?
One answer
What's exactly a patch? In what scenarios we use patch?
A patch is a description of changes made to a file (or a whole directory). In other words, it is the difference between two versions of the file.
Compared to a changeset, it is a bit more flexible and a bit less exact. A changeset is what changes a file from state A to state B. Neither A nor B are negotiable, they are set in stone once the changeset is completed. If you have the file in state C, which is similar to A but still different, you can't apply the changeset.
A patch can be applied to a changed file though, it tries to find the place inside the file where to change things and then applies the changes there. If the file was modified in between creating the patch and applying it, and those changes are where the patch would change the file, applying the patch fails because it can't establish the required context. If the changes are elsewhere, the patch can be applied without problem.
Uli