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 :-(.
On Fri, 23 Jul 2004 14:56:43 -0500, Ben Collins-Sussman
<email@example.com> 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: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Fri Jul 23 22:32:19 2004