0

I'm new to SVN, we use StarTeam 5.4, and we are going to change to SVN as soon as possible. I'm testing SmartSVN as client.

I created a repository, a trunk with one file, and a branch. In the branch, I changed the file, checked it in, and now I'm trying to "officialize" this change to trunk.

The problem is when I use "Reintegrate Merge", the file is copied to the folder, but not updated in the repository. Then I have to check it in again, now I have a Revision 3 file in my trunk and a Revision 2 file in my branch.

Is this how it work? Is it not supposed to have a Revision 2 identical file in the two folders? Or at least a identical Revision 3?

maiconmm
  • 311
  • 4
  • 16

3 Answers3

2

It's not just how it works, it's a feature! By forcing you to explicitly commit a merge, it makes it easy to revert all changes and start over if something goes horribly wrong while merging. Merging is always a working-copy operation to allow you to review the changes (and test them!) before inflicting them on your team.

Also, SVN does not track versions of files. SVN tracks a series of snapshots of ALL files in the repository, on any branch or tag. These snapshots are called "revisions". You don't have "a revision 3 file on trunk" and "a revision 2 file on the branch". You have a file on trunk, and a file on branch. Both files exist in both revision 2 and revision 3. On trunk, the last change to the file was in revision 3. On the branch, the last change to that file was in revision 2. In SVN, it's not technically correct to say "revision 4 of file", although that's easier to say than "file as it appeared in revision 4 at location" so that's what people will say in most situations.

Ben
  • 8,725
  • 1
  • 30
  • 48
  • So, once I add the changes to trunk, I should trow my branch away and star a new one? And a change in trunk will not reflect in branch? – maiconmm Jan 09 '14 at 15:37
  • Correct that a change in trunk will not reflect on the branch. If you want trunk changes on the branch, you will need to merge those changes over to the branch. You can clean up old unneeded branches if you want, but it's not required. They will always stick around in history if you need them later. Most people that use branches will start a new branch rather than re-use an old one if the changes are unrelated. But also a lot of people use branches very rarely and just make changes on trunk. – Ben Jan 09 '14 at 16:03
  • As other people suggest, you should at least read over the basic usage sections of the SVN book, http://svnbook.red-bean.com/ – Ben Jan 09 '14 at 16:03
0

This is how it works maiconmm yes. http://svnbook.red-bean.com/ covers this so I won't paraphrase, explaining why mixed revisions are normal and even useful (including limitations). I'd recommend referencing it while you get used to SVN.

0

You can use this utility in order to automate svn merging from one branch to another http://github.com/liveperson/Auto-Merger

Jas
  • 14,493
  • 27
  • 97
  • 148