Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`svn merge` produces different results than `svn diff`

Tags:

merge

svn

So I used to think I was halfway decent with svn, but this particular problem is thwarting me...

I've got a topic branch where I've added some files and made one minor modification. I merged all changes from trunk that occurred from the time my topic branch was cut until head via:

svn merge ^/trunk@revN ^/trunk@HEAD with the branch as my working copy.

I commit those changes to the branch and now the different between my branch and trunk looks kind of like this:

> svn diff ^/trunk ^/branches/KULRICE-5050 --summarize
D       https://test.kuali.org/svn/rice/trunk/impl/src/main/groovy/org/kuali/rice/kim/impl/attribute/KimAttributeDataBo.groovy
M       https://test.kuali.org/svn/rice/trunk/kim/kim-impl/src/test/groovy/org/kuali/rice/kim/impl/role/RolePermissionBoTest.groovy
A       https://test.kuali.org/svn/rice/trunk/kim/kim-impl/src/test/groovy/org/kuali/rice/kim/impl/role/RoleResponsibilityActionBoTest.groovy
A       https://test.kuali.org/svn/rice/trunk/kim/kim-impl/src/test/groovy/org/kuali/rice/kim/impl/role/RoleBoTest.groovy
...

In other words, nothing I didn't expect. These are the files I have changed in my branch.

I then try to merge the branch down in to trunk via:

svn merge ^/trunk ^/branches/KULRICE-5050 with trunk as my working copy. Instead of having those files modified that diff --summarize showed I end up seeing the following:

> svn merge ^/trunk ^/branches/KULRICE-5050
--- Merging differences between repository URLs into '.':
D    impl/src/main/groovy/org/kuali/rice/kim/impl/attribute/KimAttributeDataBo.groovy
U    kim/kim-impl/src/test/groovy/org/kuali/rice/kim/impl/role/RolePermissionBoTest.groovy
Skipped 'kim/kim-impl/src/test/groovy/org/kuali/rice/kim/impl/role/RoleResponsibilityActionBoTest.groovy'
Skipped 'kim/kim-impl/src/test/groovy/org/kuali/rice/kim/impl/role/RoleBoTest.groovy'
Skipped 'kim/kim-impl/src/test/groovy/org/kuali/rice/kim/impl/role/RoleResponsibilityBoTest.groovy'
Skipped 'kim/kim-impl/src/test/groovy/org/kuali/rice/kim/impl/role/RoleMemberBoTest.groovy'
A    kim/kim-impl/src/main/java/org/kuali/rice/kim/impl/role
...
...
Skipped 'kim/kim-api/src/main/java/org/kuali/rice/kim/api/role/RoleResponsibilityActionContract.java'
Summary of conflicts:
  Skipped paths: 38
--- Merging r20279 through r20321 into '.':
...
...
Summary of conflicts:
  Tree conflicts: 171
  Skipped paths: 33
--- Reverse-merging r20321 through r20279 into '.':
...

The ... above indicate places where I've left out the details. It's just a bunch of updates and conflicts of files that should be nowhere near my changeset.

Why on earth is merge in this case trying to apply a merge and a reverse merge across different revision ranges when all I've specified is 'give me the diff between the trunk and branch and merge that into my trunk WC'? It shouldn't be doing anything with revision ranges. Do you have any ideas why this is happening and what I need to modify in my svn commands to correct it?

My svn client is svn, version 1.6.15 (r1038135) and the svn server is 1.4.5 (r25188). The server version is out of my control, hence the older style of merging instead of using svn merge tracking.

like image 781
whaley Avatar asked May 10 '11 21:05

whaley


People also ask

What does svn merge do?

This basic syntax— svn merge URL —tells Subversion to merge all changes which have not been previously merged from the URL to the current working directory (which is typically the root of your working copy).

How do I merge two svn revisions?

Examples. Merge a branch back into the trunk (assuming that you have an up-to-date working copy of the trunk): $ svn merge --reintegrate \ http://svn.example.com/repos/calc/branches/my-calc-branch --- Merging differences between repository URLs into '. ': U button.

What is svn reverse merge?

Reverse merge In SVN SVN will keep common file contents in working copy from the specific revision of file and HEAD revision of working copy. if it is folder level. In SVN reverse merge, if not file found in the specific revision, it keeps the working copy as it is.


1 Answers

Perhaps it was "Rubber Ducking" at work, but the answer here is that I need to specify --ignore-ancestry to my merge command. Otherwise, the 1.6 svn client attempts, implicitly, a merge with merge tracking on my behalf even though the server is still 1.4 and doesn't support merge tracking.

like image 81
whaley Avatar answered Oct 04 '22 04:10

whaley