public DiffItemVersionedFile(VersionControlServer versionControl, int itemId, int changeset, string displayPath) { this.versionControlServer = versionControl; this.item = versionControl.GetItem(itemId, changeset); this.label = displayPath; }
public DiffItemVersionedFile(VersionControlServer versionControl, int itemId, int changeset, string displayPath) { this.versionControlServer = versionControl; this.item = versionControl.GetItem(itemId, changeset); this.label = displayPath; }
public FileView(VersionControlServer vcs, string path) { view = MyTextViewFactory.CreateNewTextView(); Add(view); if (String.IsNullOrEmpty(path)) return; Microsoft.TeamFoundation.VersionControl.Client.Item item = vcs.GetItem(path, VersionSpec.Latest, 0, true); string tname = System.IO.Path.GetTempFileName(); item.DownloadFile(tname); using (StreamReader sr = new StreamReader(tname)) { view.Update(path, sr.ReadToEnd()); } File.Delete(tname); }
public void Workspace_GetItems3() { // need TFS_ envvars for this test if (String.IsNullOrEmpty(tfsUrl)) { return; } TeamFoundationServer tfs = new TeamFoundationServer(tfsUrl, credentials); VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer)); string itemPath = String.Format("$/{0}/*", Environment.GetEnvironmentVariable("TFS_PROJECT")); ItemSet itemSet = vcs.GetItems(itemPath, RecursionType.OneLevel); Item[] items = itemSet.Items; foreach (Item item in items) { Item x = vcs.GetItem(item.ItemId, 1); Assert.AreEqual(x.ItemId, item.ItemId); Assert.IsNotNull(x.ArtifactUri); } }
public IItem GetItem(string path, Version version) { return(new Item(_versionControlServer.GetItem(path, version.Spec()))); }