Пример #1
0
        protected override Task <object> RemoteExecuteAsync(IRemoteOperationExecutionContext context)
        {
            this.LogInformation($"Apply label '{this.Label}' to '{this.SourcePath}'...");

            using (var client = new TfsSourceControlClient(this.TeamProjectCollectionUrl, this.UserName, this.PasswordOrToken, this.Domain, this))
            {
                client.ApplyLabel(new TfsSourcePath(this.SourcePath), this.Label, AH.CoalesceString(this.Comment, "Label applied by BuildMaster"));
            }

            this.LogInformation("Label applied.");

            return(Complete);
        }
Пример #2
0
        public Task <IEnumerable <IPathInfo> > GetPathInfosAsync(string path, IComponentConfiguration config)
        {
            var info = new PathBrowserInfo(config);

            if (string.IsNullOrEmpty(info.TeamProjectCollection))
            {
                throw new InvalidOperationException("The TFS Team Project Collection URL could not be determined.");
            }

            using (var client = new TfsSourceControlClient(info.TeamProjectCollection, info.UserName, info.Password, info.Domain, Logger.Null))
            {
                var paths = client.EnumerateChildSourcePaths(new TfsSourcePath(path));

                return(Task.FromResult(paths.Where(p => p.IsDirectory == true).Cast <IPathInfo>()));
            }
        }