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

Re: Advice Needed: Merging Branch back into Trunk

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2003-04-01 20:44:33 CEST

"Richard In Public" <edification@blueyonder.co.uk> writes:

> What I'm trying is the following:
>
> 1. Create a new directory into which I checkout .../branches/mybranch
> 2. Merge the branch into this wc, thus (executed within the new directory):
>
> svn merge http://myserver/svn/myrepos/trunk
> http://myserver/svn/myrepos/branches/mybranch .
> 3. Commit this directory.

This is a common fallacy.

Suppose you have /trunk, then copy it to /mybranch. Then you make
changes on /mybranch for a while, and want to merge the branch back
into the trunk.

'svn merge' compares two URLs, and merges the diffs into a working
copy as a local mod.

That means that to begin with, you need a working copy of /trunk.

Then you want to compare *two versions of the branch* to generate the
diffs. You do *not* want to compare /trunk and /branch, which is what
you're doing above.

In other words, you want to do something like this:

  $ svn co http://.../trunk

  $ svn merge http://.../branch@X http://.../branch@Y .

  $ svn commit

X is the revision in which /branch was first created, and Y is
typically HEAD.

If you repeat this merge later on, you have to be careful not to
remerge changes that were applied already. You need to compare
/branch@(Y+1) with /branch@HEAD.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 1 20:45:41 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.