Ryan Schmidt wrote:
> On Apr 28, 2006, at 20:28, Dan Mahn wrote:
>
>> I have a file that I edited in a branch (this is a test file) and I'm
>> merging the change back to the trunk.
>>
>> If I do a "diff" between the revisions I want to merge, I get a single
>> line of difference. However, when I do the "merge" with the same
>> revision numbers as the "diff", I get a "conflict", and two lines were
>> added to the file instead of one.
>>
>> For instance, here's the "diff" output showing the change I want to
>> merge back to trunk:
>>
>> >svn diff -r 68:69 https://<etc., etc.)/myproject.c
>
> "etc., etc." is the URL to your branch, yes? The branch where the change
> that you want to merge was made?
>
Yes, I should have been more clear. That's the URL to the branch.
>
>> Index: myproject.c
>> ===================================================================
>> --- myproject.c (revision 68)
>> +++ myproject.c (revision 69)
>> @@ -2,6 +2,7 @@
>>
>> func()
>> {
>> +printf("What about task starter?\n");
>> printf("Starting up ...\n");
>> return 0;
>> }
>>
>>
>> The contents of the pre-merge (trunk working copy) "myproject.c" file
>> are (without the equals signs):
>>
>> =====
>> //This is a test
>>
>> func()
>> {
>> return 0;
>> }
>> =====
>>
>>
>> The result of a "merge" is:
>>
>> >svn merge -r 68:69 https://<etc., etc.>/myproject.c
>
> "etc., etc." is still the URL to the same branch, yes?
>
Yes.
> You don't have to type the name of the file there at the end of the
> path, by the way; just the directory that matches the one in the working
> copy you're in will suffice. Unless there are other changes in r69 made
> to other files in the same directory and you don't want to merge those.
> But I think that would be unusual.
>
I only wanted the changes to that particular file, so I thought maybe
this would be the way to do it.
>> C myproject.c
>>
>> >svn diff
>> Index: myproject.c
>> ===================================================================
>> --- myproject.c (revision 70)
>> +++ myproject.c (working copy)
>> @@ -2,5 +2,10 @@
>>
>> func()
>> {
>> +<<<<<<< .working
>> +=======
>> +printf("What about task starter?\n");
>> +printf("Starting up ...\n");
>> +>>>>>>> .merge-right.r69
>> return 0;
>> }
>>
>> It's funny, but there appears to be an extra line in there. The lower
>> printf() call has been added, but I didn't expect that.
>
> Honestly, I didn't expect that either. Was your trunk working copy
> up-to-date before you tried this merge?
>
Yes, it was up to date.
>
>> One extenuating circumstance is that the file ("myproject.c") had been
>> moved to a sub-directory in a previous edit to the branch. However,
>> I'm not sure if this ought to affect the outcome. (The file had been
>> first moved to a new directory when working on "trunk", then I created
>> a branch from the working copy, then I added the "Starting up"
>> printf(), then I added the "task starter" printf().)
>
> It may end up being traceable to the same problem as in your last mail:
> the first revision of your branch does not match any revision of the
> trunk, therefore merges won't make sense. Try it again following the
> advice I sent in the other mail and see if you can still produce the
> problem.
>
Yes, that might make sense, but this didn't involve the controversial
revision. Also, there was no error produced. It simply didn't come up
with the results I expected.
...
I had another merging problem on Friday that I need to look into. We
created another database for real work. We entered the current version
of code and made a branch for one of us, then started working with the
branch. The first thing we noticed after we did a build was that we
needed an additional "ignore" property on a directory. We added it to
the branch, switched to trunk, then tried to merge the property change.
We could've just set the property in trunk, but I wanted to show
another person how to merge the change. The log for the branch told me
that the last two revisions were 6 and 8. Revision 8 was the one where
I had added the property. I did the merge from the branch, specifying
revision 6 to 8, but it didn't do anything. I tried this twice. Then I
tried merging from 6 to HEAD, and it merged the change. Am I wrong that
merging from 6 to 8 should perform the changes I made when committing
revision 8? I don't understand why it didn't work.
Thanks again.
- Dan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Apr 30 05:01:37 2006