Ejemplo n.º 1
0
        private void ReposLV_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ReposLV.SelectedItems.Count > 0)
            {
                ManagerData.Selected_Repo = ManagerData.Selected_Store._Repos[ReposLV.SelectedItems[0].Name];

                ManagerData.Copy_Selected_Repo();

                if (ManagerData.Selected_Repo != null)
                {
                    MainStatusSSL.Text = ManagerData.Selected_Repo.Path;
                }

                RepoStatusCB.Enabled = true;
                CloneRepoBT.Visible  = true;

                if (!ManagerData.Selected_Repo.Logs_Parsed && Properties.Settings.Default.LogParseMethod == 0 || Properties.Settings.Default.LogParseMethod == 1)
                {
                    try
                    {
                        Process LogP = RepoHelpers.Create_Process(ManagerData.Selected_Repo.Path, " git --no-pager log");
                        LogP.Start();
                        string Raw_Log = LogP.StandardOutput.ReadToEnd();
                        LogP.StandardInput.WriteLine("exit");
                        LogP.WaitForExit();

                        if (Properties.Settings.Default.LogParseMethod == 1 && ManagerData.Selected_Repo.Logs != null)
                        {
                            ManagerData.Selected_Repo.Logs.Clear();
                        }

                        RepoHelpers.Parse_Logs(Raw_Log, ManagerData.Selected_Repo);
                        ManagerData.Selected_Repo.Logs_Parsed = true;

                        if (Properties.Settings.Default.LogParseMethod == 0)
                        {
                            ManagerData.Selected_Repo.Logs_Parsed = true;
                        }
                    }

                    catch (Exception ex)
                    {
                    }
                }

                Populate_Info_List();
            }

            else
            {
                RepoStatusCB.Enabled       = false;
                RepoStatusCB.SelectedIndex = -1;
                RepoPathTB.Clear();
                LastCommitTB.Clear();
                LastCommitMessageTB.Clear();
                MainStatusSSL.Text  = string.Empty;
                CloneRepoBT.Visible = false;
            }
        }
Ejemplo n.º 2
0
 private void ClearRepoChangesBT_Click(object sender, EventArgs e)
 {
     ManagerData.Copy_Selected_Repo();
     Populate_Info_List();
 }