2

SVN merge (branch to trunk) has given me a ton of trouble. Now I am not an expert at it and that is part of the problem (then again I shouldn't be an expert at it... as that is the point, it should make my life easier). Anyway, I have a rapidly developing framework and quite a few times folders/files get deleted/renamed. Deletion/renaming itself is unintuitive in SVN (through tortoise anyway) but I'll let that slide.

Problem occurs when I am merging. If I have deleted/renamed a file or directory I get tree conflicts. Sometimes the merge fails to add a file to the trunk which was added to a branch and keeps on telling me that merge is successful (and no files are added). I have now resorted to manually merging these problem branches.

Manual merge is dead easy except when there is a rename or a deletion. I will take rename as deletion as well, because in the end that is what it really is. Is there a way to automatically delete the folders and files that are left in the trunk when I do a manual merge?

This is how I am doing a manual merge

  1. Export all the changed files from the branch
  2. Switch to trunk, over-write all the existing files while adding new folders/files as well
  3. Commit

To reiterate, the hard way to delete the renamed/deleted files/folders is to do a comparison. Is there an easier way?

Thanks!

P.S: I am thinking of switching to mercurial because merging is not a daunting task as it is in SVN, or so I have heard... is there any weight to that claim?

Community
  • 1
  • 1
Samaursa
  • 16,527
  • 21
  • 89
  • 160

1 Answers1

0

When I do this kind of manual merging (e.g. when re-importing sources from some external project repeatedly when this project has no public version control), I usually write a script that does a tree compare. It will list all files in both trees, and compare these lists. One such script that ships with subversion is svn_load_dirs.

As for your observation that automatic merging of additions and deletions fails: if you want to get help on that, please post it as a separate question. It might be that you are doing something wrong - this is supposed to work.

Martin v. Löwis
  • 124,830
  • 17
  • 198
  • 235
  • Thank you for the suggestion. I did a checkout of both the trunk and the branch in question and manually went through all the folders/files and deleted the older files/folders, then performed a commit. I then did a tree compare with tortoise svn to make sure the branch and the trunk were the same. The comparison it gives me was confusing. It still showed differences when in fact they were now the same. – Samaursa Nov 10 '10 at 01:00