Exemplo n.º 1
0
        public void CheckinSolution(CheckinSolutionInput input)
        {
            var solutionFilePath = input.SolutionFilePath;
            var comment          = input.Comment;

            var solutionFileDirectory = Path.GetDirectoryName(solutionFilePath) + Path.DirectorySeparatorChar;

            var tfsServerUri = GetTfsServerPath(solutionFilePath);

            var pc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(tfsServerUri));

            var workspaceInfo = Workstation.Current.GetLocalWorkspaceInfo(solutionFilePath);

            var workspace = workspaceInfo?.GetWorkspace(pc);

            if (workspace == null)
            {
                input.ResultMessage = "Workspace not found. @SolutionFilePath: " + input.SolutionFilePath;
                return;
            }

            var change = workspace.GetPendingChangesEnumerable().Where(p => p.LocalItem.ToUpperEN().StartsWith(solutionFileDirectory.ToUpperEN())).ToArray();

            if (change.Any())
            {
                workspace.CheckIn(change.ToArray(), comment);

                input.ResultMessage = "Successfully checked in. @File Count: " + change.Length;
            }
            else
            {
                input.ResultMessage = "There is no pending changes in solution: " + solutionFileDirectory;
            }
        }
Exemplo n.º 2
0
        public void CheckinSolution()
        {
            var input = new CheckinSolutionInput
            {
                Comment          = "INC292087# -",
                SolutionFilePath = @"D:\work\BOA.Retired\Dev\BOA.Kernel.DataAccess\BOA.Kernel.DataAccess.sln"
            };

            Api.CheckinSolution(input);
        }