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

RE: Synchronizing two branches

From: Casper Hornstrup <chorns_at_users.sourceforge.net>
Date: 2004-06-27 10:20:23 CEST


> -----Original Message-----
> From: Ben Collins-Sussman [mailto:sussman@collab.net]
> Sent: 27. juni 2004 00:33
> To: Casper Hornstrup
> Cc: users@subversion.tigris.org
> Subject: RE: Synchronizing two branches
> On Sat, 2004-06-26 at 17:16, Casper Hornstrup wrote:
> > I should have created the branch directory first using svn mkdir,
> > committed, and then imported the sources to it or done it
> completely differently?
> I think I'm completely confused about what you're trying to
> do. I assumed that you were doing the "standard" SCM
> branching/merging thing:
> * import some code to /trunk.
> * copy /trunk to /branches/somebranch
> * make changes to both the trunk and somebranch over many days.
> * "port" all the changes made on somebranch back to the trunk.
> But it seems like that's not what you're doing. You don't
> have two lines of development evolving independently at all.
> Are you simply importing two independent trees into two
> directories, and then wanting to 'sync' them? If so, there's
> no history in either branch to work from. What does 'sync'
> mean? What do you want to happen?
> Sorry for my confusion.

The scenario I'm trying to find a solution for is this:

For each "normal" branch I have another branch that mirrors the
normal branch. The layout in the repository is:


Now, you checkin your patch on the branch in the checkin directory.
Then some software notices that and will checkout the corresponding
branch (for instance trunk corresponds to checkin/trunk), apply the
patch you just checked in, build the working copy and run tests and
if everything went okay, then the software will merge the patch to
the corresponding branch (trunk in this case). If the working copy
failed to build, or a test failed then the software will revert the
change just committed by you.

This ensures that the trunk branch and branches in the branches
directory will always build and that all tests pass for the contents
of these branches.

Now this is all good, but if some event happen that cause the
software to loose information about the state of the repository
then there may be conflicts when merging which cannot be resolved
since it is an automated system. There could happen a power failure
for instance. So at startup of this software (service), I want to
make sure that the branches (trunk and checkin/trunk and branchA and
checkin/branches/branchA in this case) are equal. I would like to do
this by applying the difference between checkin/trunk and trunk to
checkin/trunk, so checkin/trunk becomes equal (has exactly the same
contents) to trunk which we know is good.

Now, I could just "svn rm checkin/trunk" and "svn cp trunk checkin/trunk",
but then, on their next "svn up", developers would see their working copy
go away and reapear and most likely this will cause merge conflicts in
their working copy.

More information is available at:


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Jun 27 10:25:20 2004

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.