Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 561
Brian R. Bondy Avatar asked Mar 07 '09 20:03

Brian R. Bondy


People also ask

How do I merge two SVN revisions?

To merge a range of revisions, use svn merge -r start:end from to where start and end are revision IDs. This will merge all revisions starting at start+1 up to and INCLUDING end . Note: it will NOT include the first revision (ex: -r3:45 will merge 4 through 45).

What is SVN reverse merge?

Reverse merge In SVN SVN will keep common file contents in working copy from the specific revision of file and HEAD revision of working copy. if it is folder level. In SVN reverse merge, if not file found in the specific revision, it keeps the working copy as it is.


2 Answers

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.

like image 184
RibaldEddie Avatar answered Oct 12 '22 15:10

RibaldEddie


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.

like image 40
Wim Coenen Avatar answered Oct 12 '22 15:10

Wim Coenen