Question

my situation is the following:

  1. I downloaded a project at revision A (the project is using SVN)
  2. I developed an new feature to propose it as a patch
  3. I now do have the patch, which gives you the feature when you apply it to revision A
  4. Since step 1 the project developed further and is now on revision B.
  5. I now need to know how to get my feature as a patch, which can be applied to revision B and integrates my feature there.

Is there any way to do this? Unfortunately I am more into Git than SVN... :(

Thanks in advance!

Was it helpful?

Solution

The beauty of patches is that they often can apply even if the code it was generated from has changed slightly.

You can use SVN patches with the standard "patch" utility on Unix-like systems, which has also been ported to Windows (http://gnuwin32.sourceforge.net/packages/patch.htm). This utility gives you a fair amount of control over how the patch is applied and how much "fuzz" to take into account while trying to apply it. Once you've applied your patch, check the svn diff to make sure that all your changes are included and you don't need to modify it any to get it working with the latest code, then you can regenerate the patch so that it applies cleanly.

If the code has changed too much, or on the same lines as you modified in your patch, then one or more "hunks" will likely fail. In this case, the patch utility will tell you what failed, and you can apply those changes manually before re-creating your patch.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top