Tp.SourceControl.Testing.Repository.Tfs.TfsTestRepository.GetLatestRevision C# (CSharp) Method

GetLatestRevision() public method

public GetLatestRevision ( ) : string
return string
		public string GetLatestRevision()
		{
			var collection = new TfsTeamProjectCollection(new Uri(ConfigHelper.Instance.TestCollection));
			var vcs = collection.GetService<VersionControlServer>();
			TeamProject tp = vcs.GetTeamProject(ConfigHelper.Instance.TestCollectionProject);
			var maxChangeset = vcs.QueryHistory(
									tp.ServerItem,
									VersionSpec.Latest,
									0,
									RecursionType.Full,
									null,
									null,
									null,
									Int32.MaxValue,
									true,
									true).Cast<Changeset>().Max(x => x.ChangesetId);

			collection.Dispose();

			return maxChangeset.ToString(CultureInfo.InvariantCulture);
		}