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

前端 未结 10 2056
独厮守ぢ
独厮守ぢ 2020-12-04 12:55

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

相关标签:
10条回答
  • 2020-12-04 13:17

    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.

    0 讨论(0)
  • 2020-12-04 13:20

    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.

    0 讨论(0)
  • 2020-12-04 13:21

    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.

    0 讨论(0)
  • 2020-12-04 13:29

    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"
    
    0 讨论(0)
  • 2020-12-04 13:29

    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!

    0 讨论(0)
  • 2020-12-04 13:32

    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 .
    
    0 讨论(0)
提交回复
热议问题