示例#1
0
        private void historyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (treeListView1.SelectedIndices.Count > 0)
            {
                Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer vcs = tfsinterface.SCMUtils.GetTFSServer(_tfsServer);

                foreach (int idx in treeListView1.SelectedIndices)
                {
                    HistoryViewerForm     hist = new HistoryViewerForm();
                    branch_order.TreeItem item = treeListView1.GetModelObject(idx) as branch_order.TreeItem;

                    hist.setInfos(vcs, item.FullPath, (int)numericUpDown1.Value);
                    hist.Show();
                }
            }
        }
示例#2
0
        public Form1()
        {
            InitializeComponent();
            treeListView1.CanExpandGetter = branch_order.TreeItem.HasChildren;
            treeListView1.ChildrenGetter  = branch_order.TreeItem.ChildrenGetter;

            _vcs        = tfsinterface.SCMUtils.GetTFSServer(_tfsServer);
            _workspaces = new tfsinterface.TFSWorkspaces(_vcs);

            List <string> workspace_names = new List <string>();

            foreach (Microsoft.TeamFoundation.VersionControl.Client.Workspace w in _workspaces.Workspaces)
            {
                workspace_names.Add(w.DisplayName);
            }

            _workspacesCB.DataSource = workspace_names;
        }
示例#3
0
 public Program(IBuildDetail[] builds, IEnumerable <string> options, IEnumerable <string> exclusions, WorkItemStore workItemStore, Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer versionControlServer, TestManagementService tms)
 {
     this.Builds                = builds;
     this.NoteOptions           = options;
     this.Exclusions            = exclusions;
     this.WorkItemStore         = workItemStore;
     this.VersionControlServer  = versionControlServer;
     this.TestManagementService = tms;
 }
示例#4
0
 public void setInfos(Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer vcs, string tfsPath, int historyCount)
 {
     _vcs          = vcs;
     _tfsPath      = tfsPath;
     _historyCount = historyCount;
 }
示例#5
0
        static int Main(string[] args)
        {
            ArgParser argparser = new ArgParser();

            argparser.add(
                new Arg('s', "server-name", "tfs server to connect to",
                        new string[] { "the name of the server" }, null)
                );

            List <int> unknownArgs;
            bool       argError = !argparser.parse_args(args, out unknownArgs);

            if (argError ||
                unknownArgs.Count < 0)
            {
                argparser.print_help("[item path]",
                                     new string[]
                {
                    "item path - tfs-server path of an item to check merge history for.",
                    null,
                    "test an item-based querying solution.",
                    "e.g. itembranchhistory -s foo $/foo/bar.cs",
                });

                return(1);
            }

            string server = (string)argparser.get_arg <Arg>(0);
            string path   = args[unknownArgs[0]];

            Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer vcs =
                megahistory.Utils.GetTFSServer(server);

            BranchHistory bh = new BranchHistory();

            Microsoft.TeamFoundation.VersionControl.Client.VersionSpec ver =
                Microsoft.TeamFoundation.VersionControl.Client.VersionSpec.Latest;
            Microsoft.TeamFoundation.VersionControl.Client.Item item =
                vcs.GetItem(path, ver, 0, false);

            treelib.AVLTree <Microsoft.TeamFoundation.VersionControl.Client.Changeset> changes =
                bh.decompose(vcs, item);

            if (changes.empty())
            {
                Console.WriteLine("no changesets found.");
            }

            for (treelib.AVLTree <Microsoft.TeamFoundation.VersionControl.Client.Changeset> .iterator it =
                     changes.begin();
                 it != changes.end();
                 ++it)
            {
                Microsoft.TeamFoundation.VersionControl.Client.Change cng = it.item().Changes[0];

                Console.WriteLine("{0} {1}",
                                  cng.ChangeType.ToString(),
                                  cng.Item.ServerItem);
            }

            return(0);
        }