md4
md4

Reputation: 1669

Applying a fix to multiple tags in SVN repo

Background

We have shared code libraries for which we have to maintain multiple versions (some legacy applications can only work with older versions of these libraries). These exist in their own repo and are imported into applications that need them via svn:externals. Recently we had to apply a security patch to all in-use versions.

Question

What's the best way to apply retrospective patches to old tags from a repo structure point of view, and could the way I chose to do it (described below) have any adverse affects?

The way I chose to do it at the time was to:

  1. Make changes to /trunk and commit (it was a relatively small change).
  2. Tag as latest version (as normal).
  3. For each older tag to be maintained
    1. Switch working copy to tag
    2. Merge in changes (essentially /trunk@HEAD) and modify as necessary.
    3. Tag local changes to major.minor.1 (so, /tags/1.3 would be svn copied to /tags/1.3.1).

This effectively chained the tags. Since we didn't maintain a perpetual branch for each major.minor version, this seemed the only way to do it.

Upvotes: 1

Views: 63

Answers (1)

Ben
Ben

Reputation: 8905

For each tag, I would have done an svn update or svn switch to the trunk revision that has the tag, and would have created a branch from that point.

Then I would have done a cherry-pick merge from trunk to each branch, to get the couple of patches needed for backport.

Then, I would have tagged from each branch.

This way no tags get modified and you still have accurate history and a full set of tags.

If you name the branch somewhat generically (e.g. 1.2.x) then if you have future fixes to backport those also can go on the branch to save you creating another one.

Upvotes: 1

Related Questions