Visual Studios 2008中的Perforce问题

时间:2022-08-27 20:26:37

My team uses Visual Studios 2008 to develop SSIS packages and we use Perforce as our source control system. When a user adds a file to a project, the project is automatically checked out WITHOUT checking to see if it is the current version. Is there a way to force Visual Studios to get the latest version of a file before it is checked out?

我的团队使用Visual Studios 2008开发SSIS包,我们使用Perforce作为源控制系统。当用户将文件添加到项目时,项目会自动检出而不检查它是否是当前版本。有没有办法强制Visual Studios在签出之前获取最新版本的文件?

We usually determine this happened after files go "missing" in Visual Studios. Here's what usually happens:

我们通常会在Visual Studio中“丢失”文件后确定这种情况。这是通常发生的事情:

  1. User A adds a file to the project.
  2. 用户A将文件添加到项目中。

  3. User A checks in both the project and the new file.
  4. 用户A检入项目和新文件。

  5. User B checks out the project without getting the latest version
  6. 用户B在没有获得最新版本的情况下检出项目

  7. User B adds a file.
  8. 用户B添加文件。

  9. User B checks in both the project and the new file.
  10. 用户B检入项目和新文件。

  11. User A gets the latest project definition and notices their file is "missing".
  12. 用户A获取最新的项目定义,并注意到他们的文件“丢失”。

As a preventative measure I require my team members to get the latest project definition immediately before adding files. Despite this precaution, mistakes continue to happen and the files "disappear". Although we can retrieve them from Perforce manually and add them back to the project definition, we shouldn't have to go through this pain at all. I know Perforce can detect changes to files automatically. Perforce will automatically compare your local copy to the server version and replace the local version if it detects a difference when you select undo check-out. There has to be a way to force it to check BEFORE it allows the file to be checked-out like VSS. It's sad when my developers tell me they WANT to go back to VSS.

作为一种预防措施,我要求我的团队成员在添加文件之前立即获取最新的项目定义。尽管有这种预防措施,但错误仍在继续,文件“消失”。虽然我们可以手动从Perforce中检索它们并将它们添加回项目定义,但我们根本不应该经历这种痛苦。我知道Perforce可以自动检测文件的变化。 Perforce将自动将本地副本与服务器版本进行比较,如果在选择撤消签出时检测到差异,则替换本地版本。在允许文件像VSS一样签出之前,必须有一种强制它检查的方法。当我的开发人员告诉我他们想要回到VSS时,这很难过。

1 个解决方案

#1


This could be an issue with a "shared" workspace client being used with P4SCC and Visual Studio. Workspace clients should be unique to each user and machine -- Perforce uses the workspace client to track the contents of a specific machine's workspace.

这可能是与P4SCC和Visual Studio一起使用的“共享”工作空间客户端的问题。 Workspace客户端应该对每个用户和计算机都是唯一的 - Perforce使用工作区客户端来跟踪特定计算机工作区的内容。

Here's how it happens when both users are using the same workspace client:

以下是两个用户使用相同工作区客户端时的情况:

  • Both Users A and B force sync to the latest revisions using the "standard_1" client. The have table is updated on the server, noting that project "foo" is at revision #12.

    用户A和B都使用“standard_1”客户端强制同步到最新版本。必须在服务器上更新have表,注意项目“foo”位于版本#12。

  • User B checks out "foo", adds a file, and submits. Now the have table is updated and notes that project "foo" is at revision #13 in the standard_1 workspace.

    用户B检出“foo”,添加文件并提交。现在更新了have表,并注意到项目“foo”位于standard_1工作区的修订版#13。

  • User A now checks out project "foo", adds a file, and submits -- without a conflict -- as revision #14 in the standard_1 workspace, because Perforce thinks that workspace already has #13.

    用户A现在检查项目“foo”,添加文件,并提交 - 而不会发生冲突 - 作为standard_1工作区中的修订版#14,因为Perforce认为工作区已经有#13。

The solution is to confirm that each user has a workspace client specification that is unique to their machine. This will separate the have lists for each user workspace, and the warning on edit and conflict on checking in will work every time.

解决方案是确认每个用户都具有其计算机所独有的工作空间客户端规范。这将分隔每个用户工作空间的列表,并且每次都会检查编辑时的警告和签入时的冲突。

#1


This could be an issue with a "shared" workspace client being used with P4SCC and Visual Studio. Workspace clients should be unique to each user and machine -- Perforce uses the workspace client to track the contents of a specific machine's workspace.

这可能是与P4SCC和Visual Studio一起使用的“共享”工作空间客户端的问题。 Workspace客户端应该对每个用户和计算机都是唯一的 - Perforce使用工作区客户端来跟踪特定计算机工作区的内容。

Here's how it happens when both users are using the same workspace client:

以下是两个用户使用相同工作区客户端时的情况:

  • Both Users A and B force sync to the latest revisions using the "standard_1" client. The have table is updated on the server, noting that project "foo" is at revision #12.

    用户A和B都使用“standard_1”客户端强制同步到最新版本。必须在服务器上更新have表,注意项目“foo”位于版本#12。

  • User B checks out "foo", adds a file, and submits. Now the have table is updated and notes that project "foo" is at revision #13 in the standard_1 workspace.

    用户B检出“foo”,添加文件并提交。现在更新了have表,并注意到项目“foo”位于standard_1工作区的修订版#13。

  • User A now checks out project "foo", adds a file, and submits -- without a conflict -- as revision #14 in the standard_1 workspace, because Perforce thinks that workspace already has #13.

    用户A现在检查项目“foo”,添加文件,并提交 - 而不会发生冲突 - 作为standard_1工作区中的修订版#14,因为Perforce认为工作区已经有#13。

The solution is to confirm that each user has a workspace client specification that is unique to their machine. This will separate the have lists for each user workspace, and the warning on edit and conflict on checking in will work every time.

解决方案是确认每个用户都具有其计算机所独有的工作空间客户端规范。这将分隔每个用户工作空间的列表,并且每次都会检查编辑时的警告和签入时的冲突。