Question

I have a branch which I created from the trunk some time ago. Since I created the branch, I didn't touch the trunk. Now, I want to return from the branch to the trunk. This is a very simple case, since there's not much merging to do. Nothing changed in the trunk. The branch can fully replace the trunk.

As I see it, I have two options:

  1. Delete the trunk (rename it to something else, delete it later) and rename the branch to be the trunk.
  2. Merge the branch to the trunk (move my working copy to the trunk and use the Merge command from the branch).

I'm not sure which option is preferred. It is important for me to maintain the revision context (not to break the revision graph).

Any thoughts?

Was it helpful?

Solution

You really should use the merge option. The argument of loosing revision information as all changes will be inside 1 commit is negligible, as subversions merge-tracking will preserve this information. If you still have a pre-1.5 installation, you can note the revision range and the branch-path in your commit message.

As you did not change anything in trunk, the merge will be a no-brainer, as you just say:

svn merge branchname <Workingcopy-Path>

(Of course your Working copy should point to trunk)

Answers to your comment

svn 1.4 has no merge tracking, so you should not rollback

Why you should not rename branch to trunk:

This is just not the way you should work In your simple setup this would be working, however, your trunk will be deleted and all files will be added again, but you cannot easily track the changed files, as in your action all files were added.

If you merge, only files you changed in branch will be displayed as modified.

Also all workingcopys from old trunk will be invalidated(as you work alone, this may not be important), so you need to check out them again.

OTHER TIPS

In your case I would prefer the first options The other way around all modifications you done in the branch are applied as one revision to the trunk. So you loose the revision information for those changes. If you move the branch to the location of your old trunk directory revision information stays intact.

I think the easiest way (dont really know if it is the best to do) is to use "svn move" inorder for you to execute the first option.

Copy and move in svn should work like file operations, also these changes are versioned.

EDIT: My answer was almost like one of the answers on the previous topics mentioned by VonC so you should take a look at this answer

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