当前位置: 首页>>代码示例>>C#>>正文


C# VersionControlServer.GetChangeset方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:JeffreyVest,项目名称:TfsPbiReader,代码行数:14,代码来源:Program.cs

示例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);
            }
    }
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:72,代码来源:DiffItemNull.cs

示例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;
        }
开发者ID:modulexcite,项目名称:CustomActivities,代码行数:11,代码来源:BuildReport.cs

示例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;
                }
            }
        }
开发者ID:RKishore222,项目名称:TestProject,代码行数:12,代码来源:GetLatestCodeFromTFS.cs

示例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);
                }
        }
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:10,代码来源:ChangesetDetailView.cs


注:本文中的Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer.GetChangeset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。