private void btnReadInfo_Click(object sender, EventArgs e) { log.WriteInfoLog("查询递交包路径,修改单编号:" + txbAmenNo.Text + "..."); ap = new AmendPack(txbAmenNo.Text); if (ap.scmstatus == ScmStatus.Error) { return; } if (ap.QueryFTP() == false) { ap.scmstatus = ScmStatus.Error; log.WriteErrorLog("查询FTP目录信息错误。"); return; } if (ap.CheckAmendStatus() == false) { ap.scmstatus = ScmStatus.Error; foreach (KeyValuePair <string, string> kvp in ap.ReworkList) { if (!ap.ReworkStatus.Contains(kvp.Value)) { string sta; if (!ap.StatusDict.TryGetValue(kvp.Value, out sta)) { sta = "未知状态"; } log.WriteLog("修改单号:" + kvp.Key + ",修改单状态:" + kvp.Value + "-" + sta, LogLevel.Warning); break; } } return; } txbCommitPath.Text = ap.CommitPath; txtSubmitVer.Text = ap.ScmVer.ToString(); txtScmVer.Text = ap.ScmedVer.ToString(); if (ap.SubmitVer == 0) { txtScmVer.BackColor = System.Drawing.Color.Red; log.WriteLog("Ftp目录无递交包" + ap.AmendNo.ToString(), LogLevel.Warning); btnFlow.Enabled = false; btnDel.Enabled = false; return; } else if (ap.ScmVer == ap.ScmedVer) { txtScmVer.BackColor = System.Drawing.Color.Red; log.WriteLog("发现已经集成的递交" + ap.ScmedVer, LogLevel.Warning); } else { txtScmVer.BackColor = System.Drawing.SystemColors.Control; } btnFlow.Enabled = true; btnDel.Enabled = true; }
public CommitHelper(string LocalCommitPath) { string CommitPath = LocalCommitPath; log = OperLog.instance; // 根据路径先分解出修改单 //E:\xgd\20121030017-综业周边\20121030017-综业周边-高虎-20130705-V1\ log.WriteLog("递交路径:" + CommitPath); if (CommitPath[CommitPath.Length - 1] == '\\') { CommitPath = CommitPath.Substring(0, CommitPath.Length - 1); } int i = CommitPath.LastIndexOf("\\"); string AmendDir = CommitPath.Substring(i + 1); // 20121030017-综业周边-高虎-20130705-V1 i = AmendDir.IndexOf("-"); string AmendNo = AmendDir.Substring(0, i); // 20121030017 i = AmendDir.IndexOf('-', i + 1); string CommitDir = AmendDir.Substring(0, i); // 20121030017-综业周边 i = AmendDir.LastIndexOf("-V"); Version = int.Parse(AmendDir.Substring(i + 2)); //1 // Readme 文件名称 string Readme = "Readme-" + CommitDir + ".txt"; ap = new AmendPack(AmendNo); ap.LocalDir = CommitPath; ap.SCMAmendDir = ap.LocalDir; if (Version == 1) { ap.scmtype = ScmType.NewScm; } else { ap.scmtype = ScmType.BugScm; } pr = new PackerReadMe(); pr.ProcessComs(ap); pr.ProcessMods(ap); pr.ProcessSAWPath(ap); // 全部修改 #region // 输出下处理结果 foreach (CommitCom c in ap.ComComms) { log.WriteFileLog("名称:" + c.cname + " " + "状态:" + Enum.GetName(typeof(ComStatus), c.cstatus) + " " + "版本:" + c.cver + " " + "路径:" + c.path); } //log.WriteFileLog("[配置库文件]"); foreach (SAWFile s in ap.SAWFiles) { log.WriteFileLog("路径:" + s.Path + " " + "本地路径:" + s.LocalPath + " " + "SvnUri:" + s.UriPath + " " + "文件状态:" + Enum.GetName(typeof(FileStatus), s.fstatus)); } #endregion }