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

Re: how to pick up the revisions on a renamed branch?

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Sat, 20 Sep 2008 14:54:30 -0500

On Sep 20, 2008, at 11:12 AM, Robert P. J. Day wrote:

> whoops, never mind, i think i puzzled it out.

For the benefit of others who might be wondering, you could tell us
what you found. But I'll take a stab at it.

> Quoting "Robert P. J. Day" <rpjday_at_crashcourse.ca>:
>
>> i suspect there's an easy way to do this with svn 1.5 but i'm
>> currently stuck with 1.4 for a while so i'm open to suggestions.
>>
>> - start with trunk
>> - to do some specialized work, create branch "b1" and get to
>> work on "b1"
>> - after a while, create a more specialized branch off of "b1"
>> called "b2" and get to work on "b2"
>> - after a while working on "b2", realize it's a bad name and
>> "svn rename" it to "c2" instead, continue working on "c2"
>> - finally done, time to start merging everything back
>>
>> uh oh.
>>
>> my first thought is that i want to merge everything on the b2/c2
>> branch back into b1, then merge *that* back into trunk. but at
>> this point, how do i get access to the revisions that were on
>> the former "b2" branch between the time i created it from "b1",
>> and the time i renamed it to "c2"?
>>
>> technically, since i renamed "b2" -> "c2", the "b2" branch doesn't
>> exist anymore. normally, on a branch, i'd ask for the log and
>> "--stop-on-copy", but that causes the log to stop at the point of
>> the renaming.
>>
>> am i making any sense? as i see it, if i have multiple levels
>> of branching, the normal way to start merging them back in is in
>> reverse order. but i'm not sure what to do about that "missing"
>> interval that was part of a branch that no longer exists.
>>
>> is this something i would solve with peg revisions? thanks.

Subversion follows history through renames so this is not a problem.

You need to merge [the range of revisions of c2 that starts when you
first created b2 and ends at what is currently HEAD] from c2 into b1.
Then, assuming you want to merge b1 into trunk, you can do that.

Let's assume the HEAD revision is currently 500.

Use "svn log --stop-on-copy -r 1:HEAD --limit 1 url://to/branches/c2"
to find the revision in which c2 was created from b2. For the sake of
example, let's call this 400.

Now you can use "svn log --stop-on-copy -r 1:HEAD --limit 1 url://to/
branches/b2_at_399" to find the revision in which b2 was created from
b1. Let's call this 300.

So you go into a clean working copy of b1 and you merge revisions 300
thru 500 of c2 into it, like this:

cd workingcopy/of/b1
svn merge -r300:500 url://branches/c2 .

Manually resolve any conflicts, test the changes until you're
satisfied they're right, then commit, noting in your commit message
what you did:

svn ci -m "merge r300-500 from c2 branch into b1 branch"

Ok, that's done. You can delete the c2 branch now and continue work
on the b1 branch.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-09-20 21:54:56 CEST

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.