Is there a way to turn TortoiseSVN using svn:mergeinfo off?

SvnTortoisesvn

Svn Problem Overview


When I'm doing a TortoiseSVN merge, it includes a bunch of directories, and some files into the modified files, even though there are no actual changes.

It changes the property svn:mergeinfo.

Is there any reason why these properties set on the directory/files are needed? Is there any way to get around not doing these changes to svn:mergeinfo?

I usually just revert the items then commit, but this wastes extra time.

Svn Solutions


Solution 1 - Svn

That is happening, very likely, because those files and directories have the svn:mergeinfo property set from a previous merge. I don't think it's generally a good idea to merge individual files or directories in a way that causes the mergeinfo to be written to individual files. You should get into the habit of merging at the highest level possible for your workflow, so that the mergeinfo property is only set on structural directories, such as /trunk or /branches/1.0.

However, if you do find yourself with mergeinfo properties on individual files and folders, there are two things you can do: the first thing is simply to remove the svn:mergeinfo property from the files and directories in question. I'm not sure this is recommended unless you really know what you're doing, and what the effects might be. Read the documentation before you do this!

The second thing you can do is commit the property changes the way SVN wants you to, which, if you trust the software, is probably the right thing do.

That having been said, I've been working with my teammates to get in the right habits so that we don't have this annoyance any more.

Solution 2 - Svn

SVN 1.7 and later

This should be fixed in SVN 1.7. From the release notes:

> Merges no longer record mergeinfo (describing the merge) on subtrees (that have their own explicit mergeinfo), if the subtree was unaffected by the merge. This should greatly reduce the number of spurious svn:mergeinfo property changes for users who have large numbers of subtrees with explicit mergeinfo.

SVN prior to 1.7

What happens is that once a file/folder has explicit mergeinfo, each subsequent merge to the branch will update that mergeinfo even if the file/folder is unrelated. This is annoying as it introduces more and more clutter in the changelist for each merge.

To avoid this, only merge to the "root" folder of the branch, for example "/branches/maintenance2.x". None of the files or folders below "/branches/maintenance2.x" should then get mergeinfo. Follow the merging advice in the SVN book.

Unfortunately, even if you merge only at the "root" folder of the branch, empty svn:mergeinfo properties can still appear on individual files and folders when they are copied, to indicate that they have not received the same merges as their siblings.

It is probably safe to delete the superfluous subtree mergeinfo. One way to do this is by doing a recursive deletion of the svn:mergeinfo property on each file and folder in your project root. (But keep the mergeinfo on the root folder itself!)

Alternatively, you can upgrade to Subversion 1.6. I have verified that it fixes this issue. It even seems to delete superfluous mergeinfo added by earlier versions for you.

Judging from the comments there are still cases in SVN 1.6 where superfluous sub-tree mergeinfo appears. But I have not been able to reproduce that.

Solution 3 - Svn

If you do your merges with the --ignore-ancestry option, then the mergeinfo properties will not be created in the first place.

svn merge --ignore-ancestry -c 1234 svn://sourcecontrol .

Solution 4 - Svn

If you tick Ignore ancestry it will not create svn mergeinfo in the folders. If you got the svn merge information already, just revert it and do the merge again by checking the ignore ancestry.

Enter image description here

Solution 5 - Svn

svn:mergeinfo is the property Subversion uses to track merge history. I'd just let it do what it has to do... you might need merge history tracking later and discover that it doesn't work because you didn't commit those properties.

Solution 6 - Svn

The command given in Stack Overflow question Remove unnecessary svn:mergeinfo properties will remove any extra mergeinfo.

From the root of the project do:

svn propdel svn:mergeinfo -R
svn revert .
svn ci -m "Removed mergeinfo"

Solution 7 - Svn

I would add that at least one part of this bug was fixed in Subversion 1.5.5. From the 1.5.5 CHANGES file:

do not create mergeinfo for wc-wc moves or copies (r34184, -585)

That is, there was a bug in SVN prior to 1.5 where it would create mergeinfo entries that it didn't use, and were superfluous, and this is likely what the original questioner was hitting if they had a lot of svn:mergeinfo properties.

Solution 8 - Svn

We removed it recursively on our project because just about all files had this info which made mergeing very annoying (if only one file had been altered, all files had to be merged). From now on we'll only merge on the root, which should avoid this situation in the future.

It hasn't given us any problems so far. Logging is still available on files and seems to be the same (but do it at your own risk anyway!).

Oh, we did it on our trunk, just before making a new branch. This way, we can start from a clean slate.

Solution 9 - Svn

Great question and answer! We've been having this problem lately, because we're trying to work around limitations of our automated build system. Our build system auto-increments the .bdsproj and some of the .dpr/.dpk files with version and path information.

I want to change that... but right now, if you want to merge one branch with another, you get the handful of files that you changed, and then 1000 files that the build machine changed. So we've been doing "targeted" merges, sometimes a file at a time. Especially with .dpr or .bdsproj files that have legitimate changes (such as the inclusion of an extra unit). Now I know what's going on, so I can hopefully put a stop to the madness.

Thanks Stack Overflow!

Solution 10 - Svn

We also had this problem in my team, and it made the whole merge process a bit confusing. After reading this, I tried deleting the svn:mergeinfo property from a number of files, and after some further testing it looks like that solved the problem.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBrian R. BondyView Question on Stackoverflow
Solution 1 - SvnRibaldEddieView Answer on Stackoverflow
Solution 2 - SvnWim CoenenView Answer on Stackoverflow
Solution 3 - SvnChase SeibertView Answer on Stackoverflow
Solution 4 - SvnShamsView Answer on Stackoverflow
Solution 5 - SvnMauricio SchefferView Answer on Stackoverflow
Solution 6 - SvnRafaView Answer on Stackoverflow
Solution 7 - SvnPaul WaglandView Answer on Stackoverflow
Solution 8 - SvnPeterView Answer on Stackoverflow
Solution 9 - SvnChris ThorntonView Answer on Stackoverflow
Solution 10 - SvnIvar WedøeView Answer on Stackoverflow