简体   繁体   中英

process for creating and applying svn patch

I am using a 3rd party library as part of my code base. It has a bug and i have 2 choices:

  1. Create and overridden class to provide the big free behaviour.
  2. Create an svn patch for the bug

I prefer 2 because logically it makes more sense, however i am not sure of how to do this,

Do i do the following:

  1. Modify the 3rd party library code
  2. Create the patch file
  3. revert my repository
  4. Apply the patch file
  5. Add the patch file to the repository
  6. Commit my changes

??

If i should use a patch, where would this be stored in the repository?

Check for Vendor Branches :

But sometimes you want to maintain custom modifications to third-party code in your own version control system. [...] These modifications might include new functionality or bug fixes, [...].

Now you face an interesting situation. Your project could house its custom modifications to the third-party data in some disjointed fashion, such as using patch files or full-fledged alternative versions of files and directories. But these quickly become maintenance headaches, requiring some mechanism by which to apply your custom changes to the third-party code and necessitating regeneration of those changes with each successive version of the third-party code that you track.

A vendor branch is basically a directory (we call it A) with the unmodified version of your source code. You branch this directory into your project (or any other location, we call this X) and apply your path to this branch. If vendor updates his component you will import it into a directory (we call B). To update your own modified library you will do a merge between B and A and apply this to X. In this way you keep your modification but also get all changes between vendors software versions.

Keep in mind to use --ignore-ancestry option on merge command otherwise you will replace changed files and not apply the diffs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM