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

Re: Standard setup for multiple branch merges?

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-07-23 21:56:43 CEST

On Fri, 2004-07-23 at 08:40, Duncan Murdoch wrote:

> >export REPOS=https://svn.r-project.org/R
> >export RTOP=~/R-devel #adjust as necessary
> >export TAG=R-1-9-patches
> >
> >svn rm -m'branch update' $REPOS/tags/patch-update
> >svn cp -m'branch update' $REPOS/branches/$TAG $REPOS/tags/patch-update
> >
> >cd $RTOP/r-devel/R
> >svn update
> >svn merge $REPOS/tags/last-patch-update $REPOS/tags/patch-update
> >
> >find -type f | xargs grep '>>>>>>>'
> > # fix conflicts... (remember to use svn resolved for each)
> >svn commit -m 'branch update'
> >
> > # better do this right away so we don't forget...
> >svn rm -m'branch update' $REPOS/tags/last-patch-update
> >svn cp -m'branch update' $REPOS/tags/patch-update $REPOS/tags/last-patch-update

This definitely works, it's just very "involved", as you said. It's not
so pretty to look at. You're constantly destroying and creating tags as
a way of remembering merge-points.

It's funny that you do bug fixes first on the 'stable' branch, then port
them to the unstable trunk. My impression is that most projects (like
the subversion project) fix bugs on trunk and 'backport' them to the
stable branch. But I digress. :-)

In any case, the scenario is that you want to regularly merge one branch
to another, in an automated way. I can offer a different way of
automating this which doesn't use tags as 'markers' for merge points at
all... it uses revnums instead.

0. cd trunk-working-copy

1. Run 'svn st -u' or 'svn up' and parse the last line, so you have a
value for the HEAD revision (or something very close to HEAD, since
there's always a race condition against new commits. :-) )

2. Read OLDREV from a file.

3. svn merge -r OLDREV:HEAD branchURL

4. resolve conflicts; svn commit -m "Merge revisions OLDREV:HEAD from
branch to trunk"

5. Save HEAD into the file for next time.

Voila, only one revision committed.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jul 23 21:58:17 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.