Ejemplo n.º 1
0
        private void 对比ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RegistryKey svnkey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\TortoiseSVN");
            string      s      = svnkey.GetValue("ProcPath").ToString();

            if (s == null)
            {
                log.WriteErrorLog("无svn安装记录");
                return;
            }

            string  file = listView1.FocusedItem.Tag.ToString();
            Process p    = new Process();

            try
            {
                p.StartInfo.FileName = s;                                            //

                p.StartInfo.Arguments              = " /command:diff /path:" + file; // 设置执行参数
                p.StartInfo.UseShellExecute        = false;                          // 关闭Shell的使用
                p.StartInfo.RedirectStandardInput  = false;                          // 不重定向标准输入,不知道为啥,重定向好像会一直等待
                p.StartInfo.RedirectStandardOutput = false;                          //重定向标准出
                p.StartInfo.RedirectStandardError  = false;                          //重定向错误输出
                p.StartInfo.CreateNoWindow         = false;                          // 不显示窗口

                MAConf.instance.WriteLog(p.StartInfo.FileName + " " + p.StartInfo.Arguments, LogLevel.FileLog);

                p.Start();    // 启动
                p.WaitForExit();
            }
            catch (Exception ex)
            {
                MAConf.instance.WriteLog("执行比较异常" + ex.Message, LogLevel.Error);
            }
        }
Ejemplo n.º 2
0
        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;
        }