views:

79

answers:

3

I found an open source library that seems quite useful in my project. The library is however in alfa/beta state and is a bit immature. It happened that I had to manually apply a patch or make some changes completely on my own in order to get rid of some minor bugs in that lib.

The question is: how can I store and manage my custom "branch" in my SVN repository?

I'd like to keep my custom changes (that may eventually be checked into trunk by project owners) as well as I want to be able merge my version with official trunk (they may have improved something, etc).

What I already did is marking a folder (let's say Resources) with an appropriate svn:externals property. I can then update from official trunk "from within" a working copy bound to my repo. Obviously what I cannot do is commiting the changes. Seems like nothing (temporarly relocating, switching, ...) works. I even tried exporting into other folder, then making my changes and then "somehow" merging it but the only result was a bunch of errors, most of them complaining about the repo guids mismatch. But maybe I missed some detail :).

So any ideas how to use an always up-to-date third party open source library and manage own customizations? I don't consider storing only .patch files in my repo as an option ;).

+3  A: 

While you cannot branch between repositories exactly, you can import the code in your own repository, and then perform merges between repositories. (The linked post implies that there are problems with this feature, but I believe it is fully supported in the latest SVN releases. SVN 1.6.1 had a bug fix related to this scenario.)

The SVN book describes a more general strategy which does not make use of cross-repository merges. It also works if the 3rd party code does not live in a SVN repository at all. See the section on Vendor Branches.

Wim Coenen
+1  A: 

Check out Piston, it does exactly what you want with ease.

http://piston.rubyforge.org/

I use it to maintain an upstream repository and it works quite well.

Paul Lindner
A: 

Instead of SVN you can use a distributed version control software. For example Git supports synchronizing branches with an SVN repository.

Esko Luontola