示例#1
0
        private ArrayList getUnpublishedFiles(String path)
        {
            this.Cursor = Cursors.WaitCursor;

            if (scan == false)
            {
                int trimIndex = path.IndexOf("art");
                path = path.Substring(trimIndex, path.Length - trimIndex);
                path = "//depot/phoenix/xbox/published/" + path.Replace("\\", "/");
            }

            p4 = new P4Connection();
            p4.Connect();
            p4I = new P4Interface();

            ArrayList unpublished = new ArrayList();

            String[]    args   = { "-n", "-d", "-i", "-t", "-v", "-b", "phx_published", path };
            P4RecordSet record = p4I.Run("integrate", args);

            foreach (P4Record entry in record)
            {
                unpublished.Add(entry.Fields["fromFile"]);
            }
            this.Cursor = Cursors.Default;
            return(unpublished);

            p4.Disconnect();
        }
示例#2
0
        private ArrayList getUnpublishedFiles()
        {
            this.Cursor = Cursors.WaitCursor;
            Scanning scan = new Scanning();

            scan.StartPosition = FormStartPosition.CenterParent;
            scan.Show();
            scan.Refresh();

            p4 = new P4Connection();
            p4.Connect();
            p4I = new P4Interface();

            ArrayList unpublished = new ArrayList();

            String[] args = { "-n", "-d", "-i", "-t", "-v", "-b", "phx_published", "//depot/phoenix/xbox/published/..." };

            // logging
            String tmp = "";

            foreach (String t in args)
            {
                tmp += t;
                tmp += " ";
            }
            LogLine(String.Concat("Running: Integrate ", tmp));

            P4RecordSet record = p4I.Run("integrate", args);

            LogLine(String.Concat("Total Records: ", record.Records.Length));
            foreach (P4Record entry in record)
            {
                if (checkBoxFilter.Checked)
                {
                    String file      = entry.Fields["depotFile"];
                    String delim     = "/";
                    int    trimIndex = -1;
                    if (file.Split(delim.ToCharArray())[6] == "art")
                    {
                        trimIndex = file.IndexOf("art");
                    }
                    else if (file.Split(delim.ToCharArray())[6] == "scenario")
                    {
                        trimIndex = file.IndexOf("scenario");
                    }

                    file = file.Substring(trimIndex, file.Length - trimIndex);
                    file = "//depot/phoenix/xbox/published/" + file.Replace("\\", "/");

                    String[]    args2   = { file.Replace("//depot/phoenix/xbox/published", localPath).Replace("\\", "/") };
                    P4RecordSet changes = p4I.Run("changes", args2);

                    if (changes.Records.Length > 0 && changes[0].Fields["user"] == comboBoxUsers.SelectedItem.ToString())
                    {
                        LogLine(String.Concat("Record: ", entry.Fields["depotFile"]));
                        unpublished.Add(entry.Fields["fromFile"]);
                    }
                }
                else
                {
                    unpublished.Add(entry.Fields["fromFile"]);
                }
            }
            scan.Close();
            this.Cursor = Cursors.Default;
            return(unpublished);

            p4.Disconnect();
        }