如何解决与SVN属性的合并冲突?

时间:2020-03-06 14:55:13  来源:igfitidea点击:

很长一段时间以来,这一直困扰着我-如何在目录上设置的SVN属性内正确解决合并冲突?举例来说,有两个开发人员正在某个项目中的某个目录上设置了svn:ignore的项目。如果两个开发人员都对此属性进行了更改,则第二个更新时,他们将看到合并冲突。

与文件合并冲突不同,目录" dir_conflicts.prej"中会生成一个文件,第二个开发人员必须读取该文件并手动进行更正。通常,我最终要做的是将所有更改都还原到本地副本,然后使用dir_conflicts.prej中的信息手动重新设置这些属性。但是,这在我们的许多项目使用的svn:externals属性中处理大量URL时非常麻烦。

必须有一个更好的方法来做到这一点-有人知道吗?

解决方案

我希望我可以提供一个更有希望的解决方案,但是根据我的经验,目前尚无法使用TortoiseSVN合并svn属性。参见http://svn.haxx.se/tsvn/archive-2008-09/0212.shtml。

我们是说在提交/更新或者分支合并时发生合并冲突吗?

SVN书非常清楚svn:ignore属性,特别是:

Subversion does not assume that every
  file or subdirectory in a working copy
  directory is intended for version
  control. Resources must be explicitly
  placed under Subversion's management
  using the svn add or svn import 
  commands.

...

To force every user of that repository to add patterns for those resources to their run-time configuration areas would be not just a burden, but has the potential to clash with the configuration needs of other working copies that the user has checked out.

经过一些额外的研究,只是快速更新-无法轻松合并SVN属性。我最初描述的方法(还原,合并.prej文件中的数据,propset,重新提交)似乎是解决此类问题的最佳方法。