Exemplo n.º 1
0
        protected string CreateChangeList(string description)
        {
            SDResults sdresults = this.connection.Run("change -o", true, true);

            sdresults.WaitUntilFinished();
            if (sdresults.ErrorOutput.Count != 0)
            {
                throw new SourceDepotException("Error: can't get a change specification.");
            }

            SDCommandOutput sdoutput   = sdresults.StructuredOutput[0];
            SDSpecData      sdspecForm = sdoutput.Variables.SpecData;

            // set up view
            sdspecForm["Description"] = description;
            connection.SpecData       = sdspecForm.FormattedSpec;
            sdresults = connection.Run("change -i", true, true);
            sdresults.WaitUntilFinished();
            if (sdresults.ErrorOutput.Count != 0)
            {
                throw new SourceDepotException("Error: didn't get a change list number...");
            }

            // Change XXXXXX created
            SourceDepotCommandResult result = new SourceDepotCommandResult(sdresults);
            var resultMessages = result.GetMessages();

            string[] separator = new string[1] {
                " "
            };
            if (resultMessages.Count == 1)
            {
                string[] splitResult = resultMessages[0].Split(separator, StringSplitOptions.RemoveEmptyEntries);
                return(splitResult[1]);
            }
            else
            {
                throw new SourceDepotException("Error: didn't get a change list number...");
            }
        }
Exemplo n.º 2
0
        protected void DefineMapping(string root, object views)
        {
            SDResults sdresults = this.connection.Run("client -o", true, true);

            sdresults.WaitUntilFinished();
            if (sdresults.ErrorOutput.Count != 0)
            {
                throw new SourceDepotException("Error: can't get a client specification.");
            }

            SDCommandOutput sdoutput   = sdresults.StructuredOutput[0];
            SDSpecData      sdspecForm = sdoutput.Variables.SpecData;

            // set up view
            sdspecForm["Root"]  = root;
            sdspecForm["View"]  = views;
            connection.SpecData = sdspecForm.FormattedSpec;
            sdresults           = connection.Run("client -i", true, true);
            sdresults.WaitUntilFinished();
            if (sdresults.ErrorOutput.Count != 0)
            {
                throw new SourceDepotException("Error: didn't get a client mapping...");
            }
        }