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

Re: First time use of merge reintegrate

From: Mark Phippard <markphip_at_gmail.com>
Date: Mon, 18 Aug 2008 14:50:52 -0400

On Mon, Aug 18, 2008 at 2:30 PM, rjk1408 <rohanjoseph_at_gmail.com> wrote:

> I have a few questions on reintegrate. From my understanding, reintegrate is
> to be used only when merging in changes from a development branch into the
> trunk so that only unique changes made on the branch make it back to the
> trunk.
>
> In this light, I present a simple use case.
>
> I have a file, foo, inside the trunk folder of my working copy, to which I
> add 1 line at the very top - 'foo-trunk'.
>
> I commit this change in revision #2. I make two user branches, A and B, in
> revision numbers 3 and 4 respectively. These two branches now contain the
> foo file with that 1 line.
>
> In branch A working copy, I append a line 'foo-user1' to the foo file and
> commit the change. The file looks like this
>
> foo-trunk
> foo-user1
>
> This happens in revision number 5.
>
>
> In branch B working copy, I append two lines, 'foo-user1' and 'foo-user2' to
> the foo file and commit the change. It looks like this
>
> foo-trunk
> foo-user1
> foo-user2
>
> This happens in revision number 6.
>
> Now, I try my first merge from inside the trunk folder- from Branch A to the
> trunk
>
> svn merge --reintegrate URL-To-Branch-A .
>
> The merge is successful and the file inside the trunk folder looks like this
>
> foo-trunk
> foo-user1
>
> I commit this change and attempt the 2nd merge - from Branch B to this trunk
> folder and it fails!
>
> the file now looks like this
>
> foo-trunk
> <<<<<<< .working
> foo-user1
> =======
> foo-user1
> foo-user2
>>>>>>>> .merge-right.rN
>
> Why did the merge fail?

It fails because merge wants to insert 2 lines of code after
foo-trunk, and a different line of code has already been inserted. It
cannot know if you intend to have foo-user1 appear once or twice in
the merged result.

> I tried the same merge using the 2 url syntax (which actually is what
> happens internally with the --reintegrate)
>
> svn merge URL-to-Branch-B_at_revision-after-the-branch-was-created
> URL-to-Branch-B_at_HEAD .
>
> And this worked!

That is not the right merge syntax. It would have been this:

 svn merge URL-to-trunk_at_2 URL-to-Branch-B_at_HEAD .

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-08-18 20:51:18 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.