Пример #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.OutputString.Append("\nCan not perform auto pull, when merge option is set to fetch.");
                    else
                    {
                        bool pullCompleted;
                        GitUICommands.Instance.StartPullDialog(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(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;
        }
Пример #6
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 (GitUICommands.Instance.StartPullDialog(true))
                    {
                        form.Retry();
                        return true;
                    }
                }
            }

            return false;
        }