0

Scenario:

I'm using svn:externals to grab Microsoft.Practices.ServiceLocation from CodePlex. However, referencing the csproj-file in my own project causes an upgrade from 2005 to 2008. This makes my copy of the project file different from the base copy, and I am unable to update the project from subversion.

An update of ...\deps\Microsoft.Practices.ServiceLocation results in:

Command          Update
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ServiceLocatorProvider.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ServiceLocator.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\Readme.txt
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\Properties
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\Microsoft.Practices.ServiceLocation.csproj
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\IServiceLocator.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ActivationException.Desktop.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ActivationException.cs
Completed        At revision: 43682
warning!         One or more files are in a conflicted state.

An update of ...\deps results in:

Command          Update
Completed        At revision: 0

An update of the root results in:

Command           Update
External          ...\deps\Microsoft.Practices.ServiceLocation
External failed   ...\deps\Microsoft.Practices.ServiceLocation
Error             Working copy '...\deps\Microsoft.Practices.ServiceLocation' locked
Error             Please execute the 'Cleanup' command.
Completed         ...\deps\Microsoft.Practices.ServiceLocation - at revision: 0

The messing claiming that the working copy is locked seems to be wrong, executing Release lock on the Microsoft.Practices.ServiceLocation folder results in a message stating "There's nothing to unlock. No file has a lock in this working copy." Same result if I execute the command at the root.

Executing a cleanup changed nothing.

I'm using TortoiseSVN.

  1. Can I tell Visual Studio 2008 to treat a project/directory as readonly to avoid an upgrade?
  2. Is there a secret Subversion command I can execute to get this to work?
  3. Why does an update of files that havnt changed cause a tree conflict?

Edit: I've googled some, and found the Subversion documentation explaining tree conflicts at http://svnbook.red-bean.com/nightly/en/svn.tour.treeconflicts.html. I changed my third question since I dont understand why I'm getting a tree conflict when updating files that havnt changed.

4

2 回答 2

2

根据您对项目的参与程度以及是否要对其进行更改,有多种选择。

对于我主要用于库的项目,我没有将开源项目放入我的解决方案中 - 只是我保存在库文件夹中的源代码控制存储库中的 dll。

调试时可以在 VS2008 中单步执行库的代码,而无需实际打开 2005 项目文件;所以不需要更新。

当我确实需要处理开源库的代码时,我会在它自己的解决方案中打开它。如果它需要更新到 vs2008,我就让它 - 这没什么大不了的,因为只有项目文件被更改 - 而不是源代码。由于它在源代码控制中,您始终可以将项目文件还原为原始文件或重命名新副本并并排保留 2 个 csproj 文件。

我只在开源项目上用乌龟做一个 svn-update 并且没有冲突。Svn 会将任何更改合并到我的副本中。如果我有开源项目需要的更改,我会提交一个补丁并且不要从我的副本中提交。

如果这是一个您是活跃的开发人员并且其他团队成员需要留在 VS2005 中的项目,那么您可以并排加载 VS2005 而不会出现问题。我在同一台机器上安装了 4-5 个 VS 副本——唯一的缺点是磁盘空间。

如果您有太多冲突,听起来您可能需要将项目重新签出到新文件夹中。然后您可以使用一个好的差异工具手动解决冲突 - 我使用 WinMerge。

于 2009-10-03T00:06:44.773 回答
1

Visual Studio 2008 将非常高兴地打开一个只读解决方案(这是正常的、未签出的用法)。

但是VS2008无法打开VS 2005的解决方案文件,所以总是尝试升级。您似乎正在寻找一种无需升级即可在 2008 年打开 2005 年解决方案的方法,我认为这是不可能的。

要么获取 VS 2005 的副本(这可能是 Express 版本),要么获取 Codeplex 项目作为一个整体进行升级(记住 VS 2008 将针对 .NET 2.0)。

于 2009-09-20T10:12:29.830 回答