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(); }
public Form1() { InitializeComponent(); appSettings = new Settings("data.dat"); p4 = new P4Connection(); p4.ExceptionLevel = P4ExceptionLevels.ExceptionOnBothErrorsAndWarnings; p4.Connect(); if (!p4.IsValidConnection(true, true)) { MessageBox.Show("No valid p4 connection."); } p4I = new P4Interface(); p4I.Connect(); if (!p4I.IsValidConnection()) { MessageBox.Show("No valid p4I connection."); } checkedNodes = new ArrayList(); foreach (String user in p4I.GetUsers()) { comboBoxUsers.Items.Add(user.ToLower()); } comboBoxUsers.SelectedItem = p4.User.ToLower().ToString(); BuildLocalPaths(); MarkUnpublishedFolders(getUnpublishedFiles()); ExpandNode(treeView1.Nodes[0]); p4.Disconnect(); }
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(); }