views:

1172

answers:

4

When we do our branching and merging with svn, we always have the same thing happen.

We get a latest copy of the trunk.

Create a branch and switch.

Make some small change on one file in the branch.

Merge branch back into trunk.

At this point, we'll have our one file that needs to be comittied, plus the same 45 extra files. This happens on every single branch and merge, and its always the same 45 extra files. I have no idea how to fix the problem, but its extremely annoying.

Has anyone ever seen this before?

UPDATE: When I do the commit, the files that I actually changed have their Text Status as modified and their property status as blank. The "45 files" are all Text Status normal, Property Status modified.

+6  A: 

its probably mergeinfo properties. with 1.5 version of SVN, it was quite aggressive with setting the mergeinfo property, and as you merge, those properties get updated - requiring a commit to them.

The answer is to delete the mergeinfo property on them. Also upgrade to 1.6 which has better mergeinfo support (ie it writes much fewer of these properties)

I should say that these file will have no visible changes if you look at the differences. Obviously, if they're contents are changed, then what the changes are may give you a clue (eg is an automated tool writing extra comments, modifying the layout or adding lines to the top or bottom).

EDIT: see this blog post for more information on SVN merging issues, and fixes.

gbjbaanb
Is this something I should be doing on a regular basis?I was apprehensive of upgrading to 1.6 after an ominous Tweet from CodingHorror.
Jonathan Beerhalter
I've upgraded my client (tortoise) and the cache can make explorer pause; I'd stay with 1.5.5 for a while longer, and just be more careful with merging - I tend to merge on a 'top level' directory only, never subdirs and have never had this problem.
gbjbaanb
I just spotted additional files in a merge the other day and recognized them as files that had been merged previously. Can you confirm that removal of the svn:mergeinfo attribute from all but your project root is a safe operation? Any negative consequences to consider? And... is this a bug or expected behavior do you think?
Mark Renouf
mergeinfo simply tells svn what has already been merged. Remove it and you've just fallen back to the old manual way of merging - ie merging everything, or merging revision ranges you select yourself. If you only merge from the root from now on, you'll still get the benefits of the mergeinfo there. (BTW this removal of MI from subdirs is called elison or eliding them, search the svn mailing list for that). They're working on making it better.
gbjbaanb
+4  A: 

Most likely it is the mergeinfo properties as mentioned. You will probably want to clean up the mergeinfo properties on the files and folders in your trunk. A batch file is handy for this as you may need to do this sometime again in the future. Something like the following:

echo Removing Nested Merge Information...

svn propdel svn:mergeinfo subfolder1 --depth=infinity

svn propdel svn:mergeinfo subfolder2 --depth=infinity

svn propget svn:mergeinfo --depth=infinity trunk

Then commit back to trunk after you have ran the batch file on a working copy of trunk.

Also, renaming and moving folders is a common way to generate a mergeinfo property on a folder/file in a subversion repo. svn1.6 isn't as generous about adding the mergeinfo property for the various actions.

jluebker
A: 

Personally, I think mergeinfo causes more problems than it solves, at least with the current state of the tooling. Once it's transparent on commits, maybe it will be worth using.

You can safely delete mergeinfo properties. However, be aware that you will need to manually track which revisions to merge for re-integrations.

Chase Seibert
A: 

This question has already been asked on SO, but there were less responses.

js