本文整理汇总了C#中Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer类的典型用法代码示例。如果您正苦于以下问题:C# VersionControlServer类的具体用法?C# VersionControlServer怎么用?C# VersionControlServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VersionControlServer类属于Microsoft.TeamFoundation.VersionControl.Client命名空间,在下文中一共展示了VersionControlServer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DiffItemVersionedFile
public DiffItemVersionedFile(Item item, VersionSpec versionSpec)
{
this.versionControlServer = item.VersionControlServer;
this.item = item;
this.versionSpec = versionSpec;
this.label = item.ServerItem;
}
示例2: FixtureSetUp
public void FixtureSetUp()
{
tfsUrl = Environment.GetEnvironmentVariable("TFS_URL");
if (String.IsNullOrEmpty(tfsUrl))
{
Console.WriteLine("Warning: Environment variable TFS_URL not set.");
Console.WriteLine(" Some tests cannot be executed without TFS_URL.");
return;
}
string username = Environment.GetEnvironmentVariable("TFS_USERNAME");
if (String.IsNullOrEmpty(username))
{
Console.WriteLine("Warning: No TFS user credentials specified.");
return;
}
credentials = new NetworkCredential(username,
Environment.GetEnvironmentVariable("TFS_PASSWORD"),
Environment.GetEnvironmentVariable("TFS_DOMAIN"));
// need TFS_ envvars for this test
if (String.IsNullOrEmpty(tfsUrl)) return;
TeamFoundationServer tfs = new TeamFoundationServer(tfsUrl, credentials);
versionControlServer = (VersionControlServer) tfs.GetService(typeof(VersionControlServer));
workspace = versionControlServer.CreateWorkspace("WorkspaceTest",
Environment.GetEnvironmentVariable("TFS_USERNAME"));
}
示例3: GettingDialog
public GettingDialog(VersionControlServer vcs, Workspace workspace, GetRequest[] requests)
: base("Progress")
{
VBox.Spacing = 10;
VBox.Add(new Label("Getting files from the server..."));
progressBar = new ProgressBar();
VBox.Add(progressBar);
fileLabel = new Label("");
VBox.Add(fileLabel);
AddCloseButton("Cancel");
DefaultResponse = ResponseType.Cancel;
ShowAll();
getLatestList.Clear();
vcs.Getting += MyGettingEventHandler;
GetStatus status = workspace.Get(requests, GetOptions.GetAll|GetOptions.Overwrite);
foreach (string file in getLatestList)
{
Console.WriteLine(file);
Pulse("Setting permissions: " + file);
if (! FileTypeDatabase.ShouldBeExecutable(file)) continue;
FileType.MakeExecutable(file);
}
}
示例4: ProcessWorkItemRelationships
/// <summary>
/// Method for processing work items down to the changesets that are related to them
/// </summary>
/// <param name="wi">Work Item to process</param>
/// <param name="outputFile">File to write the dgml to</param>
/// <param name="vcs">Version Control Server which contains the changesets</param>
public void ProcessWorkItemRelationships(WorkItem[] wi,
string outputFile,
bool hideReverse,
bool groupbyIteration,
bool dependencyAnalysis,
List<TempLinkType> selectedLinks,
VersionControlServer vcs)
{
string projectName = wi[0].Project.Name;
_workItemStubs = new List<WorkItemStub>();
_wis = wi[0].Store;
_vcs = vcs;
_tms = vcs.TeamProjectCollection.GetService<ITestManagementService>();
_tmp = _tms.GetTeamProject(projectName);
_selectedLinks = selectedLinks;
//Store options
_hideReverse = hideReverse;
_groupbyIteration = groupbyIteration;
_dependencyAnalysis = dependencyAnalysis;
for (int i = 0; i < wi.Length; i++)
{
ProcessWorkItemCS(wi[i]);
}
WriteChangesetInfo(outputFile, projectName);
}
示例5: FixtureSetUp
public void FixtureSetUp()
{
tfsUrl = Environment.GetEnvironmentVariable("TFS_URL");
if (String.IsNullOrEmpty(tfsUrl))
{
Console.WriteLine("Warning: Environment variable TFS_URL not set.");
Console.WriteLine(" Some tests cannot be executed without TFS_URL.");
return;
}
string username = Environment.GetEnvironmentVariable("TFS_USERNAME");
if (String.IsNullOrEmpty(username))
{
Console.WriteLine("Warning: No TFS user credentials specified.");
return;
}
credentials = new NetworkCredential(username,
Environment.GetEnvironmentVariable("TFS_PASSWORD"),
Environment.GetEnvironmentVariable("TFS_DOMAIN"));
// need TFS_ envvars for this test
if (String.IsNullOrEmpty(tfsUrl)) return;
TeamFoundationServer tfs = new TeamFoundationServer(tfsUrl, credentials);
versionControlServer = (VersionControlServer) tfs.GetService(typeof(VersionControlServer));
WorkingFolder[] folders = new WorkingFolder[1];
string serverItem = String.Format("$/{0}", Environment.GetEnvironmentVariable("TFS_PROJECT"));
folders[0] = new WorkingFolder(serverItem, Environment.CurrentDirectory);
workspace = versionControlServer.CreateWorkspace("UpdateWorkspaceInfoCache_Workspace",
Environment.GetEnvironmentVariable("TFS_USERNAME"),
"My Comment", folders, Environment.MachineName);
}
示例6: DiffFiles
public static void DiffFiles(VersionControlServer versionControl,
IDiffItem source, IDiffItem target,
DiffOptions diffOpts, string fileNameForHeader,
bool wait)
{
DiffItemUtil aItem = new DiffItemUtil('a', fileNameForHeader, source.GetFile());
DiffItemUtil bItem = new DiffItemUtil('b', fileNameForHeader, target.GetFile());
StreamWriter stream = diffOpts.StreamWriter;
// short circuit for binary file comparisions
if (source.GetEncoding() == RepositoryConstants.EncodingBinary && target.GetEncoding() == RepositoryConstants.EncodingBinary)
{
stream.WriteLine("Binary files {0} and {1} differ", aItem.Name, bItem.Name);
return;
}
WriteHeader(aItem, bItem, diffOpts);
// short circuit new files
if (aItem.Length == 0)
{
WriteNewFile(stream, bItem.Lines);
return;
}
Hashtable hashtable = new Hashtable(aItem.Length + bItem.Length);
bool ignoreWhiteSpace = (diffOpts.Flags & DiffOptionFlags.IgnoreWhiteSpace) == DiffOptionFlags.IgnoreWhiteSpace;
DiffItem[] items = DiffUtil.DiffText(hashtable, aItem.Lines, bItem.Lines,
ignoreWhiteSpace, ignoreWhiteSpace, false);
WriteUnified(stream, aItem.Lines, bItem.Lines, items);
}
示例7: GetIdsFromHistory
static List<int> GetIdsFromHistory(string path, VersionControlServer tfsClient)
{
if (tfsClient == null)
{
tfsClient = GetTfsClient();
}
IEnumerable submissions = tfsClient.QueryHistory(
path,
VersionSpec.Latest,
0,
RecursionType.None, // Assume that the path is to a file, not a directory
null,
null,
null,
Int32.MaxValue,
false,
false);
List<int> ids = new List<int>();
foreach(Changeset cs in submissions)
{
ids.Add(cs.ChangesetId);
}
return ids;
}
示例8: ReviewItemCollectorStrategy
public ReviewItemCollectorStrategy(WorkItemStore store, VersionControlServer versionControlServer, IVisualStudioAdapter visualStudioAdapter, IReviewItemFilter filter)
{
this.store = store;
this.versionControlServer = versionControlServer;
this.visualStudioAdapter = visualStudioAdapter;
this.filter = filter;
}
示例9: Connect
public override void Connect(string serverUri, string remotePath, string localPath, int fromChangeset, string tfsUsername, string tfsPassword, string tfsDomain)
{
this._serverUri = new Uri(serverUri);
this._remotePath = remotePath;
this._localPath = localPath;
this._startingChangeset = fromChangeset;
try
{
NetworkCredential tfsCredential = new NetworkCredential(tfsUsername, tfsPassword, tfsDomain);
//this._teamFoundationServer = new Microsoft.TeamFoundation.Client.TeamFoundationServer(this._serverUri, tfsCredential);
this._tfsProjectCollection = new TfsTeamProjectCollection(this._serverUri, tfsCredential);
this._versionControlServer = this._tfsProjectCollection.GetService<VersionControlServer>();
}
catch (Exception ex)
{
throw new Exception("Error connecting to TFS", ex);
}
//clear hooked eventhandlers
BeginChangeSet = null;
EndChangeSet = null;
FileAdded = null;
FileEdited = null;
FileDeleted = null;
FileUndeleted = null;
FileBranched = null;
FileRenamed = null;
FolderAdded = null;
FolderDeleted = null;
FolderUndeleted = null;
FolderBranched = null;
FolderRenamed = null;
ChangeSetsFound = null;
}
示例10: SourceControlWrapper
public SourceControlWrapper(string teamProjectCollectionUrl, string teamProjectName)
{
this.tpcollection = new TfsTeamProjectCollection(new Uri(teamProjectCollectionUrl));
this.teamProjectName = teamProjectName;
this.vcserver = this.tpcollection.GetService<VersionControlServer>();
}
示例11: ShowChangesetDialog
public ShowChangesetDialog(VersionControlServer vcs, int cid)
: base("Changeset " + cid.ToString())
{
changesetDiffView = new ChangesetDiffView(vcs, cid);
VBox.Add(changesetDiffView);
AddCloseButton();
}
示例12: UsersLocator
public UsersLocator(IGroupSecurityService groupSecurityService, VersionControlServer versionControlServer,
TeamProject teamProject, IGroupsLocator groupsLocator)
{
m_groupSecurityService = groupSecurityService;
m_versionControlServer = versionControlServer;
m_teamProject = teamProject;
m_groupsLocator = groupsLocator;
}
示例13: FolderDiffWrapper
public FolderDiffWrapper(string assemblyPath, string srcPath, VersionSpec srcSpec, string targetPath, VersionSpec targetSpec, VersionControlServer server, RecursionType recursion)
{
_vcControlsAssembly = Assembly.LoadFrom(assemblyPath);
//internal FolderDiff(string path1, VersionSpec spec1, string path2, VersionSpec spec2, VersionControlServer server, RecursionType recursion);
FolderDiff = AccessPrivateWrapper.FromType(_vcControlsAssembly, FolderDiffTypeName,
srcPath, srcSpec, targetPath, targetSpec, server, recursion);
SetupTypesFromAssembly();
}
示例14: ReviewModel
public ReviewModel()
{
teamProjectCollectionProvider = IoC.GetInstance<IVisualStudioAdapter>();
var tpc = teamProjectCollectionProvider.GetCurrent();
workItemStore = tpc.GetService<WorkItemStore>();
versionControlServer = tpc.GetService<VersionControlServer>();
}
示例15: Connect
public virtual void Connect()
{
WorkspaceInfo wi = Workstation.Current.GetLocalWorkspaceInfo(Environment.CurrentDirectory);
using (var tfs = new TfsTeamProjectCollection(wi.ServerUri))
{
versionControlServer = tfs.GetService<VersionControlServer>();
}
}