subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Hänsel <an...@webkr.de>
Subject AW: Correcting an old branching error
Date Tue, 03 May 2011 13:41:07 GMT
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.




Mime
View raw message