Subversion将未修改的文件标记为已修改 [英] Subversion marks unmodified files as modified

查看:67
本文介绍了Subversion将未修改的文件标记为已修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在使用Subversion时遇到的一个奇怪问题:从开发分支合并到主干(或回溯到此)时,Subversion会将许多文件标记为已更改-而它们没有更改.

Here's an odd problem I encountered using Subversion: when merging from a development branch to trunk (or back, for that matter) Subversion would mark a lot of files as changed -- while they had no changes.

发生的事情是这样:

  1. 在我的分支中,我提交了1个修改过的文件
  2. 在后备箱中,我合并该提交
  3. 很多 other 文件和目录被标记为已修改",而实际上并未更改(甚至不包括空格,行尾,属性或类似内容).
  1. In my branch I commit 1 modified file
  2. In trunk I merge in that commit
  3. Lots of other files and directories are marked as 'modified' without actually having been changed (not even whitespace, line endings, properties or that sort of stuff).

从技术上讲,进行这些未更改的更改不会有任何区别,但是我不想在日志中添加噪音.

Technically, committing these unchanged changes would make no difference, but I do not want to add noise to my logs.

任何想法都可能导致这种滋扰,以及如何防止这种滋扰?我可以问一下Subversion为什么将文件标记为已修改,以便我知道它是否是文件的内容,属性等吗?

Any idea what might cause this nuisance, and how to prevent it? Can I ask Subversion why a file has been marked as modified, so I would know if it was the file's content, properties, etc.?

仅供参考:Subversion客户端在1.6.x范围内,服务器在1.5.x范围内.在Mac OS X Leopard上结合使用Versions.app和CLI.

FYI: subversion client in the 1.6.x range, server in 1.5.x range. Using a combination of Versions.app and the CLI on Mac OS X Leopard.

推荐答案

发生的事情是,一旦文件/文件夹具有显式mergeinfo(即svn:mergeinfo属性),则该分支的每个后续合并都将更新该mergeinfo甚至如果文件/文件夹不相关.这确实很烦人,因为每次合并都会在变更列表中引入越来越多的混乱情况.

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

为避免这种情况,仅合并到分支的根"文件夹,例如"/branches/maintenance2.x".然后,"/branches/maintenance2.x"下的文件或文件夹均不应获取mergeinfo.请按照合并建议svn书.

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.

不幸的是,即使仅在分支的根"文件夹中合并,复制单个文件和文件夹时,空的svn:mergeinfo属性仍会出现在各个文件和文件夹上,以表示它们没有收到与它们相同的合并兄弟姐妹.

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.

如果仅在根目录处合并,则删除多余的子树mergeinfo可能是安全的.一种方法是递归删除项目根目录中每个文件和文件夹的svn:mergeinfo属性.

If you merge only at the root, then 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.

此问题似乎已在SVN 1.7中修复.从发行说明中:减少了子树mergeinfo的更改.

This appears to have been fixed in SVN 1.7. From the release notes: Reduced subtree mergeinfo changes.

这篇关于Subversion将未修改的文件标记为已修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆