I'm using the TFS 2010 SDK to programmatically check in edits to files into TFS 2010. The documentation on the TFS 2010 SDK is sparse at best. When I call the method workspace.pendedit() passing in an array of files I want to mark as having a pending edit, nothing is actually checked out. So when I call workspace.checkin() passing in workspace.getpendingchanges and some comments I get an exception that there must be at least one thing that has a pending change (which should be what I passed into pendedit). Any thoughts on why the app isn't marking the files as having a pending edit in the workspace?
问问题
3254 次
2 回答
3
确保您以正确的顺序执行所有操作,以便 TFS 知道文件已更改。你必须:
- 首先从工作区获取文件。
- 挂起编辑
- 对文件进行更改
- 检查工作区。
例子:
GetStatus status = workspace.Get(new GetRequest(migrationPath, RecursionType.None,
VersionSpec.Latest),GetOptions.Overwrite);
workspace.PendEdit(migrationPath);
checkInAuthor = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
于 2010-06-02T15:06:34.473 回答
2
事实证明,即使我添加了文件并签入了文件,工作区似乎也没有识别出文件存在,因此我必须在 PendEdit() 之前执行 Get()
于 2010-06-04T12:14:36.997 回答