Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TortoiseSVN: How to merge branch back to trunk without switching working copy to trunk?

We are using TortoiseSVN in a team environment. When working on a bigger feature, I create a feature branch, work for a week there, merge changes from trunk to my branch every other day and when the feature is complete, I merge it back to trunk.

When merging, I always do the following:

  1. commit everything to the branch
  2. switch the whole working copy to trunk, changing (mostly deleting) hundreds of files
  3. use "Reintegrate a branch" option, merging the changed/new files from branch that were already on the disk 30 seconds ago
  4. verify that the code compiles
  5. commit to trunk

This seems inefficient to me - I create a bunch of files, delete them when switching to trunk and then create them again when merging to the trunk.

Is there any other way to merge a branch to trunk using TortoiseSVN that would be more efficient, without having two separate working copies? (which is not actually very efficient in our scenario because some dependencies use absolute paths and I need to manually change them when I want to compile from another working copy)

like image 498
Marek Avatar asked Mar 01 '10 07:03

Marek


1 Answers

You can't possibly merge and commit in SVN, without having a working copy of the trunk (i.e. the merge target). This isn't an action that can be done directly on the repository, since it is modifying files, and you will want to verify that they are merged correctly before committing.

So I guess you basically want a switch-and-merge action (or a switch-and-merge-reintegrate). As far as I know, this command is not provided by SVN or TortoiseSVN, so you are stuck doing it the way you described.

like image 197
Avi Avatar answered Oct 06 '22 18:10

Avi