本文整理汇总了C#中Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer.GetChangeset方法的典型用法代码示例。如果您正苦于以下问题:C# VersionControlServer.GetChangeset方法的具体用法?C# VersionControlServer.GetChangeset怎么用?C# VersionControlServer.GetChangeset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer
的用法示例。
在下文中一共展示了VersionControlServer.GetChangeset方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildChangesets
private static void BuildChangesets(VersionControlServer vcServer, IEnumerable<ExternalLink> taskExternalLinks, Dictionary<int, Changeset> changesets)
{
foreach (var taskExternalLink in taskExternalLinks)
{
var fileName = Path.GetFileName(taskExternalLink.LinkedArtifactUri);
if (fileName == null) continue;
var changesetNumber = int.Parse(fileName);
var changeset = vcServer.GetChangeset(changesetNumber);
if (!changesets.ContainsKey(changesetNumber))
changesets.Add(changesetNumber, changeset);
}
}
示例2: ShowChangeset
public static void ShowChangeset(VersionControlServer vcs,
ChangesetVersionSpec versionSpec,
bool brief, DiffOptions diffOpts)
{
int changesetId = versionSpec.ChangesetId;
Changeset changeset = vcs.GetChangeset(changesetId, true, true);
// fetch all items in one fell swoop
List<int> ids = new List<int>();
foreach (Change change in changeset.Changes)
ids.Add(change.Item.ItemId);
// find items in prior changeset
Item[] items = vcs.GetItems(ids.ToArray(), changesetId-1, true);
SortedList<int, Item> itemList = new SortedList<int, Item>();
foreach (Item item in items)
{
// itemId of 0 means a null item, IOW file was added in this changeset
// and missing in prior changeset
if (item.ItemId == 0) continue;
itemList.Add(item.ItemId, item);
}
foreach (Change change in changeset.Changes)
{
// skip folders
if (change.Item.ItemType == ItemType.Folder) continue;
string p = change.Item.ServerItem.Substring(2);
if (brief)
{
Console.WriteLine(p);
continue;
}
IDiffItem a = new DiffItemNull();
IDiffItem b = new DiffItemNull();
string tnameA = null;
string tnameB = null;
if (((change.ChangeType & ChangeType.Add) != ChangeType.Add) &&
(itemList.ContainsKey(change.Item.ItemId)))
{
Item itemA = itemList[change.Item.ItemId];
tnameA = Path.GetTempFileName();
itemA.DownloadFile(tnameA);
a = new DiffItemLocalFile(tnameA, itemA.Encoding,
changeset.CreationDate, true);
}
if ((change.ChangeType & ChangeType.Delete) != ChangeType.Delete)
{
tnameB = Path.GetTempFileName();
change.Item.DownloadFile(tnameB);
b = new DiffItemLocalFile(tnameB, change.Item.Encoding,
changeset.CreationDate, true);
}
diffOpts.TargetLabel = versionSpec.DisplayString;
Difference.DiffFiles(vcs, a, b, diffOpts, p, true);
if (!String.IsNullOrEmpty(tnameA))
File.Delete(tnameA);
if (!String.IsNullOrEmpty(tnameB))
File.Delete(tnameB);
}
}
示例3: GetFilesAssociatedWithBuild
private static List<Change> GetFilesAssociatedWithBuild(VersionControlServer versionControlServer, int changesetId)
{
List<Change> files = new List<Change>();
Changeset changeset = versionControlServer.GetChangeset(changesetId);
if (changeset.Changes != null)
{
files.AddRange(changeset.Changes);
}
return files;
}
示例4: GetCodeByChangeSet
private void GetCodeByChangeSet(VersionControlServer versionControl, TfsGetCodeParams objTfsGetCodeParams)
{
foreach (var changeSetId in objTfsGetCodeParams.ChangeSetNumbers)
{
Changeset changeSets = versionControl.GetChangeset(changeSetId);
foreach (var changeSetItem in changeSets.Changes)
{
Item citem = changeSetItem.Item;
}
}
}
示例5: UpdateCid
public void UpdateCid(VersionControlServer vcs, int cid)
{
Clear();
Changeset changeset = vcs.GetChangeset(cid, true, false);
foreach (Change change in changeset.Changes)
{
changesetDetailStore.AppendValues(ChangeTypeToString(change.ChangeType), change.Item.ServerItem);
}
}