Deleting files during Manual Merge in SVN
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 automat开发者_StackOverflow社区ically 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
- Export all the changed files from the branch
- Switch to trunk, over-write all the existing files while adding new folders/files as well
- 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?
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.
精彩评论