[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

AW: Correcting an old branching error

From: André Hänsel <andre_at_webkr.de>
Date: Tue, 3 May 2011 15:41:07 +0200

Robin Cull wrote:

> I have been working on this "branch" for several weeks and committing as I
> go. But rather than committing onto a branch I have really been
> committing into a subdirectory of the trunk of the main project which
> contains a duplicate of the project as due to my mistake my repository
> actually looks like this:
>
> ProjectName
> ProjectName > Module1
> ProjectName > Module2
> ProjectName > branches
> ProjectName > branches > NewPlatform > Module1
> ProjectName > branches > NewPlatform > Module2
> ProjectName > tags

Subversion doesn't care what you call "branch" and "trunk". What did you do
to take the branch, you created the "NewPlatform" directory and copied
Module1 and Module2 there using svn copy, right?
So all Subversion knows is that "ProjectName > branches > NewPlatform >
Model1" is a copy (you could call it "branch") of "ProjectName > Module1".

Now over the last few weeks you only committed to "ProjectName > Module1"
and "ProjectName > Module2" and to "ProjectName > branches > NewPlatform >
Module1" and "ProjectName > branches > NewPlatform > Module2" respectively,
correct? You did not do any merges between the two branches? That wouldn't
be a big problem, but it required a "reintegrate merge" which is slightly
more complicated.

So when you want to merge all changes you made to your "NewPlatform branch"
back into your "trunk", all you have to do is merge "NewPlatform" into
"ProjectName". Or, if you find that easier to understand, you could merge
"ProjectName > branches > NewPlatform > Module1" into "ProjectName >
Module1" and "ProjectName > branches > NewPlatform > Module2" into
"ProjectName > Module2" in a second step.

> When I try to merge the "branch" back onto the trunk I end up with two
> disparate versions of my modules, one in the ProjectName > ModuleX
> directory containing whatever it was before the branch, and a second in
> ProjectName > branches > NewPlatform > ModuleX, containing what I have
> been working on over the last few weeks.

Then you didn't do the merge correctly. Maybe you should show the commands
you used. After the merge, all changes you made to "ProjectName > branches >
NewPlatform > Module1" should also be in "ProjectName > Module1".

> It is important to note that the NewPlatform "branch" contains a different
> set of IDE project files etc. I would like to have the merged trunk to
> contain the superset of files required for each hardware platform.

Subversion knows nothing about your IDEs project files. However, if you
added files to "ProjectName > branches > NewPlatform > Module1", when
merging these files will be added to "ProjectName > Module1". But if you
deleted files in "ProjectName > branches > NewPlatform > Module1", those
files *will* be deleted in "ProjectName > Module1" (unless they are modified
there, in that case you'll get a tree conflict which you have to resolve
manually). If you don't want that those files are deleted, just revert them
*after* the merge and before you commit the merge.
Received on 2011-05-03 15:41:55 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.