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

Re: Branching / Merging Help

From: Neil Sheth <nsheth_at_gmail.com>
Date: 2007-05-22 21:38:44 CEST

From the documentation:
But which two trees should be compared? At first glance, the answer
may seem obvious: just compare the latest trunk tree with your latest
branch tree. But beware—this assumption is wrong, and has burned many
a new user! Since svn merge operates like svn diff, comparing the
latest trunk and branch trees will not merely describe the set of
changes you made to your branch. Such a comparison shows too many
changes: it would not only show the addition of your branch changes,
but also the removal of trunk changes that never happened on your

In the case I described, would this work? If i have all the changes
from trunk already in my branch, can I just compare the latest trunk
and branch trees to describe the set of changes made to the branch?

What's the current best practice for developing on a branch, in terms
of updating from trunk?

On 5/22/07, Hari Kodungallur <hkodungallur@gmail.com> wrote:
> On 5/22/07, Neil Sheth <nsheth@gmail.com> wrote:
> > Hello,
> >
> > I am relatively new to svn, and am trying to figure out the branching
> > and merging process. Looking at the documentation, I see 2 main
> > examples:
> >
> > From http://svnbook.red-bean.com/en/1.0/ch04s03.html, we
> see how to
> > get updates from the trunk into your branch. Using their example,
> > "svn merge -r 343:344
> http://svn.example.com/repos/calc/trunk " gets
> > the changes from trunk into my-calc-branch.
> >
> > From http://svnbook.red-bean.com/en/1.0/ch04s04.html, we
> see how to
> > merge the branch back into trunk. Using their example, "svn merge -r
> > 341:HEAD
> http://svn.example.com/repos/calc/branches/my-calc-branch"
> > brings the changes from my-calc-branch into a working copy of trunk.
> >
> > The second example assumes that we haven't pulled any trunk updates
> > into the branch in the course of working on the branch. The -r
> > 341:HEAD part says, give me all the changes in this branch since I
> > copied it. What if I had periodically pulled changes from trunk via
> > the first example? In this case, if I merged back into trunk, won't I
> > duplicate changes? The changes will already be in the latest trunk
> > revision, and then I'll have them repeated in the branch diff?
> >
> > In the case that we are developing in a branch for some time, I will
> > want to keep it updated with changes from trunk. What is the best way
> > to merge this type of branch back into trunk when finished?
> Periodic merges is not something that is supported by subversion currently.
> I believe 1.5 or 1.6 will have it. Until then, you will have to use some
> tool like svnmerge.py to keep track of it. This script is in
> contrib/client-side directory of the source distribution.
> regards,
> -Hari Kodungallur

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue May 22 21:39:07 2007

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.