撤消结帐 TFS [英] Undo checkout TFS
本文介绍了撤消结帐 TFS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在 C# 中以编程方式撤消结帐?
Is there any way to undo a checkout programmatically in C#?
文件以编程方式签出,但如果代码在执行时没有更改,我希望取消签出.
The files get checked out programmatically, but if the code does not change on execution, I want the checkout to be undone.
public static void CheckOutFromTFS(string fileName)
{
var workspaceInfo = Workstation.Current.GetLocalWorkspaceInfo(fileName);
if (workspaceInfo == null)
return;
var server = new TfsTeamProjectCollection(workspaceInfo.ServerUri);
var workspace = workspaceInfo.GetWorkspace(server);
workspace.PendEdit(fileName);
}
上面的代码是我的结帐代码.
The above code is my checkout code.
推荐答案
您可以使用 Workspace.Undo 方法撤消结帐.
You can use the Workspace.Undo method to undo the checkout.
这篇关于撤消结帐 TFS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文