tags:

views:

29

answers:

1

I'm working on a team with lots of people who are pretty unfamiliar with the concepts of version control systems, and are just kind of doing whatever seems to work, by trial and error. Someone created a "branch" from the trunk that is not ancestrally related to the trunk. My guess is it went something like this:

  1. They created a folder in branches.
  2. They checked out all the code from the trunk to somewhere on their desktop.
  3. They added all that code to the newly created folder as though it was a bunch of brand new files.

So the repository isn't aware that all that code is actually just a copy of the trunk. When I look at the history of that branch in TortoiseSVN, and uncheck the "Stop on copy/rename" box, there is no revision that has the trunk (or any other path) under the "Copy from path" column.

Then they made lots of changes on their "branch". Meanwhile, others were making lots of changes on the trunk. We tried to do a merge and of course it doesn't work. Because, the trunk and the fake branch are not ancestrally related.

I can see only two ways to resolve this:

  1. Go through the logs on the "branch", look at every change that was made, and manually apply each change to the trunk.
  2. Go through the logs on the trunk, look at every change that was made between revision 540 (when the "branch" was created) and HEAD, and manually apply each change to the "branch".

This involves 7 revisions one way or 11 revisions the other way, so neither one is really that terrible. But is there any way to cause the repository to "realize" that the branch really IS ancestrally related even though it was created incorrectly, so that we can take advantage of the built-in merging functionality in Eclipse/TortoiseSVN?

(You may be wondering: Why did your company hire these people and allow them to access the SVN repository without making sure they knew how to use it properly first?! We didn't -- this is a school assignment, which is a collaboration between two different classes -- the ones in the lower class were given a very quick hand-wavey "overview" of SVN which didn't really teach them anything. I've asked everyone in the group to please PLEASE read the svn book, and I'll make sure we (the slightly more experienced half of the team) keep a close eye on the repository to ensure this doesn't happen again.)

+1  A: 

you have to use the --ignore-ancestry on your merge command. By this SVN will ignore if files are added new. It just looked for the filenames

Peter Parker
Strangely enough, just using the command-line client instead of one of my GUI clients worked, even without that switch. It merged the files that had been changed, just like I wanted, and then the files that were brand new, I copied manually. Which means I probably lost some history on those files.
MatrixFrog
just make sure that all changes of your branch are inside the merged files..
Peter Parker