3

Having a rough time with my first big directory merge and was hoping for clues as to why I am getting these errors.

I branched off the code in trunk/ a week ago and made a lot of changes to the code in branches/myBranch, and decided that it was time to merge them into trunk/. No code has since been touched in the trunk, it is exactly the same as when the new code branched of, so I thought that this meant no conflicts could arise.

False assumption, it seems, as I know get a heap of conflicts when trying to merge the new code into trunk and reports of missing files. Could someone clarify why this is happening?

This is the basic facts:

  • The code was branched in revision 19466.
  • The trunk has since been untouched. No changes (Last Changed Rev: 19453).
  • The branch was (unfortunately?) done locally, incorporating some changes.
  • I tried merging the changes from the branch intro trunk using the following command: svn merge -r19466:HEAD branches/myBranch trunk/. (It didn't matter if I was standing in trunk and skipping the last argument, or just doing the above)
  • Subversion complains about a missing file, fooDao. ! C trunk/fooDao.java

    > local missing, incoming edit upon merge

    This file was renamed in the same commit that the branch was created (19466), but I thought that subversion should pick this up since it was issued using svn move. The log shows its ancestry:

    ... A /branches/myBranch/fooDao.java (from /branches/myBranch/fooDato.java:19452)

  • If you are wondering why the revision numbers increase even without code changes, it is because it is a shared repository containing many other (active projects).
oligofren
  • 20,744
  • 16
  • 93
  • 180
  • You may want to check this solution http://stackoverflow.com/questions/3776747/subversion-post-merge-tree-conflict-local-delete-incoming-edit-upon-merge – pmod Apr 04 '11 at 19:26
  • And this http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-conflicts.html - chapter "Local missing, incoming edit upon merge" – pmod Apr 04 '11 at 19:36

1 Answers1

3

The main cause of the errors I experienced were due to creating the branch in a unsound way. If you do branching correctly the brainch point will have exactly the same files as in the trunk (in that revision). If a branch created in revision 100 were to be merged into trunk I could then just use svn merge -r100:HEAD ../branches/myBranch ./trunk and get just the changes to the files in those revisions.

Unfortunately I had local modifications in trunk/ before creating the branch. These modifications were copied into the new branch and then committed. Thus the files in myBranch and trunk were different at the point of creation of the branch. To remedy the situation I had to find a revision before the branch creation to merge from (say: rev99) and do the merge from there. Any conflicts that appeared were simply solved by choosing "tf" (their full) to get the full file from the branch in a conflict. I could do this quick fix because the trunk was untouched and had no changes.

To sum it up: to avoid problems, do branching correctly by making sure

oligofren
  • 20,744
  • 16
  • 93
  • 180
  • 1
    Thank you **so** much. I have been trying sort out a similar problem for hours and this is the first post that actually explains exactly what has gone wrong. I'm not sure how I'm going to fix it yet, but at least I know **why** it is happening. – TallGuy May 01 '11 at 00:20
  • Thanks for making that comment. Always nice to know that the work involved creating a post/answer is worth something to someone out there :) – oligofren May 04 '11 at 09:17