[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: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: 2004-07-23 22:17:17 CEST

Thanks very much for your comments. They're just the sort of thing I
was looking for. Unfortunately, I asked the wrong question....

Turns out that pretty frequently we do merges for only a few files, or
for a subtree, and sometimes do backports to the stable branch. So we
can't just save the revision of the last merge in a file, we need a
more complicated scheme, more closely equivalent to a CVS tag.

I think I can simplify the original script, but I don't think I'm
going to get it as clean as what you suggested :-(.

Duncan Murdoch

On Fri, 23 Jul 2004 14:56:43 -0500, Ben Collins-Sussman
<sussman@collab.net> wrote :

>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 22:32:19 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.