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

SV: SV: Can't get merge to work as suggested

From: Tomas Sandkvist <tomas.sandkvist_at_protang.se>
Date: 2003-09-03 15:41:43 CEST

Eureka!!

Now I understand what I did wrong. Thanx alot Tim!!

As almost always, the answer where closer than what I could have guessed....

Regards,
Tomas

-----Ursprungligt meddelande-----
Från: Leeuw van der, Tim [mailto:tim.leeuwvander@nl.unisys.com]
Skickat: den 3 september 2003 15:29
Till: 'Tomas Sandkvist'
Kopia: users@subversion.tigris.org
Ämne: RE: SV: Can't get merge to work as suggested

Hi Tomas,

What you do is: see what's different between branch and trunk, and apply
those differences to trunk. Thus, your trunk ends up looking like your
branch.

What you want to do with merge is: see what's changed on the branch, and
apply that to the trunk.

How do you know what's changed on the branch? Check at what point (what
revision) the branch was created. Or, if you did merges before, what was the
revision of the last merge.
Let's assume the branch was created at rev. 50, for the sake of argument.

To see what work was done on the branch, that needs to be merged, do
something line:

svn diff -r 50:53 c:\svn_repository\projekt_A\branches\branch1\

To do the merge, you do something similar:

svn merge -r 50:53 c:\svn_repository\projekt_A\branches\branch1\ [path to
working-copy of trunk]

Hope this helps!

Regards,

--Tim

-----Original Message-----
From: Tomas Sandkvist [mailto:tomas.sandkvist@protang.se]
Sent: woensdag 3 september 2003 15:18
To: Leeuw van der, Tim
Cc: users@subversion.tigris.org
Subject: SV: Can't get merge to work as suggested

Hi Tim!!

I try to merge the branch back to the trunk. I have not been able to get
TortoiseSVN to merge at all, so all operations are performed using SVN line
commands.

These are the files:

1. The trunk file. currently at rev 59

Rad 1 - Changed
Rad 2
Rad 3
Rad 4 - Lagt till
Rad 5

2. The branch file. Currently at rev 53

Rad 1
Rad 2 - additions
Rad 3
Rad 3a
Rad 4
Rad 5
Rad 6

First I tried a diff command:

svn diff c:\svn_repository\projekt_A\trunk\Radtest.txt@59
c:\svn_repository\projekt_A\branches\branch1\Radtest.txt@53

I then get the response:

Index: Radtest.txt
==========================================================
--- Radtest.txt <revision 59>
+++ Radtest.txt <revision 53>
@@ -1,6 +1,7 @@
-Rad 1 - Changed
-Rad 2
+Rad 1
+Rad 2 - additions
 Rad 3
-Rad 4 - Lagt till
+Rad 3a
+Rad 4
 Rad 5
-
+Rad 6
\ No newline at end of file

As far as I can understand this is a correct diff response. It took me some
time to figure out the syntax that would genererate the correct diff between
the trunk and branch, I think this is what you are suggesting in you
response, the [path]@revision format.

Now I do a merge based on the diff command with current directory set to my
working directory for the trunk:

svn merge c:\svn_repository\projekt_A\trunk\Radtest.txt@59
c:\svn_repository\projekt_A\branches\branch1\Radtest.txt@53

Now the response is:

U Radtest.txt

I open the file in the current working directory and the contents are:

Rad 1
Rad 2 - additions
Rad 3
Rad 3a
Rad 4
Rad 5
Rad 6

In fact, the contents of the branch file.

Does this give you any clues? I wonder if I should learn more about diff and
merge in CVS, do you think that would be good for me to understand the
concepts better? It feels like the SVN docs is written for users that
already uses CVS, not for us without experience of that tool.

Regards,
Tomas

-----Ursprungligt meddelande-----
Från: Leeuw van der, Tim [mailto:tim.leeuwvander@nl.unisys.com]
Skickat: den 3 september 2003 14:47
Till: 'Tomas Sandkvist'; users@subversion.tigris.org
Ämne: RE: Can't get merge to work as suggested

Hiya,

Can you show us the exact commands which you are issueing?

I recall having some similar problems, which were due to TSVN giving the
wrong merge-commands.

There are 2 forms of using svn merge - I think that whichever form you're
using you should use the other form ;-) and it might work.

I *think* that what's happening, guessing from my own experience, is that
you're effectively merging the changes between branch-at-point-of-creation
and branch-at-head, and putting the result of that merge into your your
trunk-workingcopy.

So you're not merging the changes between trunk-at-head and branch-at-head.

I hope you follow me - I can't find an easy way to explain it.

With regards,

--Tim

-----Original Message-----
From: Tomas Sandkvist [mailto:tomas.sandkvist@protang.se]
Sent: woensdag 3 september 2003 14:04
To: users@subversion.tigris.org
Subject: Can't get merge to work as suggested

Hi!!

Testing out the merge function to learn how it works. I have created a trunk
and a branch of a simple text file with six lines of text.

When I try to merge the branch into the trunk it is replaced by the contents
of the branch. Any changes I've made to the trunk disapears.

A diff on these two files show all differences as it should.

Feel a bit embaressed not being able to figure this out... As far as I can
see i have done everything by the book, still I can't merge such a simple
example.

Everything runs on my local computer, SVN-0.27 is used.

Regards
Tomas Sandkvist

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Sep 3 15:41:02 2003

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.