tags:

views:

9071

answers:

2

I'm using Subversion 1.4.6. I cannot upgrade to version 1.5 right now.

The situation:

  1. The trunk has a lot of structural changes (i.e. moving files around, mostly).

  2. I have a branch that was recently merged from the trunk, but before the major changes.

What is the best way to merge the trunk to the branch?

What I had in mind:

  1. First carefully merge the branch to the trunk, by merging only the modified files in the branch to the trunk.

  2. Copy the trunk to the branch. What is the best way to do this without losing the branch history? Should I deprecate the branch and create a new one?

Thanks

[EDIT]

Okay, it looks like I didn't given SVN enough credit. It's smart enough after all. I was just put off by the output of "D" and "A", but in the background it did a move.

+10  A: 

Is there something that prevents you from merging all revisions on trunk since the last merge?

svn merge -rLastRevisionMergedFromTrunkToBranch:HEAD url/of/trunk path/to/branch/wc

should work just fine. At least if you want to merge all changes on trunk to your branch.

Stefan
When I dried-run it, there where a lot of "D" and "A" for many files, since the files where moved in the trunk. My question is if SVN remembers the files' histories in this case.
Gilad Naor
Did you use svn rename when moving files in the trunk? If you did, the history should remain. I think you should try this on a small scale - create a new repository, a trunk with a single file, a branch with a change, do an svn rename on the trunk and check whether history exists.
Yuval F
How can I know which was the last revision merged from trunk to branch?
Leandro López
in newer versions of svn it is a stored as a file property (somewhere?, perhaps the root directory). Older version do not store this info, you have to manually search for it. i.e. search the log for the commit of the last merge. (This is a major inconvenvience. Git, Mercurial, Bazaar do not have these limitations)
Ronny
+1  A: 

Last revision merged from trunk to branch can be found by running this command inside the working copy directory:

svn log -v --stop-on-copy

Anonymous
That just stops the log when the branch was created; it doesn't show any merges that happened after that point.
mos