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

Re: I screwed something up trying to merge

From: Ryan Schmidt <subversion-2007a_at_ryandesign.com>
Date: 2007-01-16 22:37:01 CET

You have misunderstood quite a lot about merging...

On Jan 16, 2007, at 15:07, Craig White wrote:

> I have a trunk, branches and tags
>
> My 'trunk' is at version 49 and my branch 'phase3' is at tag 138

Your terminology is wrong and therefore confusing you. The correct
language to describe your repository is as follows:

The HEAD revision of your repository is 138.
The last changed revision of the branch phase3 is 138.
The last changed revision of the trunk is 49.

> $ pwd
> /home/app-serve/th-db # my phase3 branch
>
> $ svn log --stop-on-copy
> ----------------------------------------------------------------------
> --
> r138 | app-serve | 2007-01-16 10:52:34 -0700 (Tue, 16 Jan 2007) | 1
> line
> <snippage>
> r52 | craig | 2006-04-24 15:42:06 -0700 (Mon, 24 Apr 2006) | 1 line
>
> I did a 'new' checkout of the trunk...
>
> $ mkdir th-db_trunk
> [app-serve@srv2 ~]$ svn checkout
> file:///home/app-serve/svn/th-db/trunk /home/app-serve/th-db_trunk/
> A /home/app-serve/th-db_trunk/test
> <snippage>
> A /home/app-serve/th-db_trunk/public/favicon.ico
> Checked out revision 138.
>
> and it checks out everything in the trunk but calls it revision 138
> and
> thus, when I do...
>
> $ svn merge --dry-run -r 52:138 file:///home/app-serve/svn/th-db/trunk
>
> it takes a second, reports nothing to the screen and thus, nothing
> is to
> be done.
>
> How do I merge all of the revisions back into the trunk?

Correct: that merge does not make sense. You are asking for revisions
52 thru 138 of trunk to be applied to the trunk. Doesn't make sense
because you're already in the trunk, and no changes have happened on
the trunk since r49. So the requested merge is empty.

Let me try to explain. A merge is nothing more than a diff and patch.
You are asking Subversion to compute the difference between trunk
revision 52 and trunk revision 138, and apply that diff to the
current working directory, which is of trunk.

The task I believe you are trying to accomplish is to merge revisions
52 thru 138 of the phase3 branch into the trunk. If that assumption
is correct, here's how you do it:

cd working-copy-of-trunk
svn merge -r58:138 file:///home/app-serve/svn/th-db/branches/phase3 .

This command means: compute a set of steps that transforms revision
58 of phase3 into revision 138 of phase3, and then perform those
steps on the current working copy of the trunk.

Then you test your working copy, and once you're satisfied everything
is OK, you commit it.

At this point you can remove the phase3 branch if you're done with
it. If you're not done, and want to make additional changes in
phase3, you can do that too. If you then later want to merge those
changes to the trunk as well, be sure to not repeat the merge of any
revisions you've done before. You merged thru 138 to the trunk
already, so if you need to merge again, beginning at revision 138
this time (not 58).

-- 
To reply to the mailing list, please use your mailer's Reply To All  
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 16 22:37:50 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.