我正在尝试使用以下代码从TFS获取签出项目列表:
我将商品列表设为ExtendedItem[] (var v)
,但它没有结帐信息( LockOwner , LockOwnerDisplayName 和 LockStatus < / strong>)项目并非专门检出。
我做错了吗?任何帮助将不胜感激。
VersionControlServer vcs = _tfsColl.GetService<VersionControlServer>();
var v = vcs.GetExtendedItems(new ItemSpec[] { new ItemSpec(p.ServerItem, RecursionType.OneLevel)}, DeletedState.NonDeleted, ItemType.Any);
答案 0 :(得分:0)
答案 1 :(得分:0)
使用此代码检索锁定信息:
TfsTeamProjectCollection collection = new TfsTeamProjectCollection(new Uri("[collection URL]"));
collection.EnsureAuthenticated();
VersionControlServer vcs = collection.GetService<VersionControlServer>();
var pendingSets = vcs.QueryPendingSets(new string[] { "[server path]" }, RecursionType.OneLevel, null, null);
foreach (PendingSet changeset in pendingSets)
{
foreach (PendingChange change in changeset.PendingChanges)
{
if(change.IsLock)
{
Console.WriteLine("Lock level:" + change.LockLevel);
Console.WriteLine("Locked By:" + changeset.OwnerName);
Console.WriteLine("Time:" + change.CreationDate);
}
}
}