Пример #1
0
        internal P4PendingChangelist(string Description, P4Connection p4)
        {
            _p4 = p4;
            P4ExceptionLevels oldEx = _p4.ExceptionLevel;

            try
            {
                // we want to throw an exception if there are any errors.
                _p4.ExceptionLevel = P4ExceptionLevels.NoExceptionOnWarnings;
                baseForm           = _p4.Fetch_Form("change");

                // clear the Jobs list
                baseForm.ArrayFields["Jobs"] = new string[0];

                // clear the Files list
                baseForm.ArrayFields["Files"] = new string[0];

                // save the description
                baseForm.Fields["Description"] = Description;

                P4UnParsedRecordSet r = _p4.Save_Form(baseForm);

                // convert to int to verify we're parsing correctly
                int changeNumber = int.Parse(r.Messages[0].Split(' ')[1]);
                baseForm.Fields["Change"] = changeNumber.ToString();
            }
            // no catch... we want the exception bubled up.
            finally
            {
                p4.ExceptionLevel = oldEx;
            }
        }
Пример #2
0
        internal P4PendingChangelist(string Description, P4Connection p4)
        {
            _p4 = p4;
            P4ExceptionLevels oldEx = _p4.ExceptionLevel;
            try
            {
                // we want to throw an exception if there are any errors.
                _p4.ExceptionLevel = P4ExceptionLevels.NoExceptionOnWarnings;
                baseForm = _p4.Fetch_Form("change");

                // clear the Jobs list
                baseForm.ArrayFields["Jobs"] = new string[0];

                // clear the Files list
                baseForm.ArrayFields["Files"] = new string[0];

                // save the description
                baseForm.Fields["Description"] = Description;

                P4UnParsedRecordSet r = _p4.Save_Form(baseForm);
            
                // convert to int to verify we're parsing correctly
                int changeNumber = int.Parse(r.Messages[0].Split(' ')[1]);
                baseForm.Fields["Change"] = changeNumber.ToString();
                
            }
            // no catch... we want the exception bubled up.
            finally
            {
                p4.ExceptionLevel = oldEx;
            }

        }
Пример #3
0
    //---------------------------------
    private void BuildClientDepotPath()
    {
        P4Form myClient = p4.Fetch_Form("client");

        String[] newView = new String[myClient.ArrayFields["View"].Length + 1];
        myClient.ArrayFields["View"].CopyTo(newView, 0);

        String client = myClient["Client"];

        clientRoot = myClient["Root"];

        if (newView[0].Contains("playtest"))
        {
            newView[0] = newView[1];
        }
        String[] pathConstructor = newView[0].Split('/');
        for (int i = 0; i < pathConstructor.Length - 2; i++)
        {
            pathConstructor[i] = pathConstructor[i + 2];
        }
        pathConstructor[pathConstructor.Length - 1] = pathConstructor[pathConstructor.Length - 2] = null;

        String[] pathArr = newView[0].Split(' ');
        String   path    = pathArr[1].Replace(String.Concat("//", client), clientRoot);

        clientPath = path.Replace("\\", "/");
        clientPath = clientPath.Replace("//", "/");
        clientPath = clientPath.Replace("/...", "");
        depotPath  = pathArr[1];
    }