AppendOutputLine() публичный Метод

Appends a line of text (CRLF added automatically) both to the logged output (FormStatus.GetOutputString) and to the display console control.
public AppendOutputLine ( string line ) : void
line string
Результат void
Пример #1
0
        private bool HandlePushOnExit(ref bool isError, FormProcess form)
        {
            if (isError)
            {
                //auto pull only if current branch was rejected
                Regex IsRejected = new Regex(Regex.Escape("! [rejected] ") + ".*" + Regex.Escape(_currentBranch) + ".*" + Regex.Escape(" (non-fast-forward)"), RegexOptions.Compiled);

                if (Settings.AutoPullOnRejected && IsRejected.IsMatch(form.OutputString.ToString()))

                {
                    if (Settings.PullMerge == Settings.PullAction.Fetch)
                    {
                        form.AppendOutputLine(Environment.NewLine + "Can not perform auto pull, when merge option is set to fetch.");
                    }
                    else if (IsRebasingMergeCommit())
                    {
                        form.AppendOutputLine(Environment.NewLine + "Can not perform auto pull, when merge option is set to rebase " + Environment.NewLine
                                              + "and one of the commits that are about to be rebased is a merge.");
                    }
                    else
                    {
                        bool pullCompleted;
                        UICommands.StartPullDialog(this, true, out pullCompleted);
                        if (pullCompleted)
                        {
                            form.Retry();
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Пример #2
0
        private bool HandlePushOnExit(ref bool isError, FormProcess form)
        {
            if (isError)
            {
                if (Settings.AutoPullOnRejected &&
                    form.OutputString.ToString().Contains("To prevent you from losing history, non-fast-forward updates were rejected"))
                {
                    if (Settings.PullMerge == Settings.PullAction.Fetch)
                    {
                        form.AppendOutputLine(Environment.NewLine + "Can not perform auto pull, when merge option is set to fetch.");
                    }
                    else if (IsRebasingMergeCommit())
                    {
                        form.AppendOutputLine(Environment.NewLine + "Can not perform auto pull, when merge option is set to rebase " + Environment.NewLine
                                              + "and one of the commits that are about to be rebased is a merge.");
                    }
                    else
                    {
                        bool pullCompleted;
                        GitUICommands.Instance.StartPullDialog(this, true, out pullCompleted);
                        if (pullCompleted)
                        {
                            form.Retry();
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Пример #3
0
        private bool HandlePushOnExit(ref bool isError, FormProcess form)
        {
            if (isError)
            {
                //auto pull only if current branch was rejected
                Regex IsRejected = new Regex(Regex.Escape("! [rejected] ") + ".*" + Regex.Escape(_currentBranch) + ".*" + Regex.Escape(" (non-fast-forward)"), RegexOptions.Compiled);

                if (Settings.AutoPullOnRejected && IsRejected.IsMatch(form.OutputString.ToString()))

                {
                    if (Settings.PullMerge == Settings.PullAction.Fetch)
                        form.AppendOutputLine(Environment.NewLine + "Can not perform auto pull, when merge option is set to fetch.");
                    else if (IsRebasingMergeCommit())
                        form.AppendOutputLine(Environment.NewLine + "Can not perform auto pull, when merge option is set to rebase " + Environment.NewLine
                                            + "and one of the commits that are about to be rebased is a merge.");
                    else
                    {
                        bool pullCompleted;
                        GitUICommands.Instance.StartPullDialog(this, true, out pullCompleted);
                        if (pullCompleted)
                        {
                            form.Retry();
                            return true;
                        }
                    }
                }
            }

            return false;
        }
Пример #4
0
        private bool HandlePushOnExit(ref bool isError, FormProcess form)
        {
            if (isError)
            {

                if (Settings.AutoPullOnRejected &&
                    form.OutputString.ToString().Contains("To prevent you from losing history, non-fast-forward updates were rejected"))
                {
                    if (Settings.PullMerge == "fetch")
                        form.AppendOutputLine(Environment.NewLine + "Can not perform auto pull, when merge option is set to fetch.");
                    else if (IsRebasingMergeCommit())
                        form.AppendOutputLine(Environment.NewLine + "Can not perform auto pull, when merge option is set to rebase " + Environment.NewLine
                                            + "and one of the commits that are about to be rebased is a merge.");
                    else
                    {
                        bool pullCompleted;
                        GitUICommands.Instance.StartPullDialog(this, true, out pullCompleted);
                        if (pullCompleted)
                        {
                            form.Retry();
                            return true;
                        }
                    }
                }
            }

            return false;
        }
Пример #5
0
        private bool HandlePushOnExit(ref bool isError, FormProcess form)
        {
            if (isError)
            {

                if (Settings.AutoPullOnRejected &&
                    form.OutputString.ToString().Contains("To prevent you from losing history, non-fast-forward updates were rejected"))
                {
                    if (Settings.PullMerge == "fetch")
                        form.AppendOutputLine("\nCan not perform auto pull, when merge option is set to fetch.");
                    else if (Settings.PullMerge == "rebase" && Settings.Module.IsMergeCommit(_currentBranch))
                        form.AppendOutputLine("\nCan not perform auto pull, when merge option is set to rebase and pushed commit is merge commit.");
                    else
                    {
                        bool pullCompleted;
                        GitUICommands.Instance.StartPullDialog(true, out pullCompleted);
                        if (pullCompleted)
                        {
                            form.Retry();
                            return true;
                        }
                    }
                }
            }

            return false;
        }