Exemple #1
0
        private bool HandlePushOnExit(ref bool isError, FormProcess form)
        {
            if (!isError)
            {
                return(false);
            }

            //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.GetOutputString()))
            {
                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(form.Owner ?? form, true, out pullCompleted);
                    if (pullCompleted)
                    {
                        form.Retry();
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemple #2
0
 public static string ReadDialog(IWin32Window owner, string process, string arguments, GitModule module, string input, bool useDialogSettings)
 {
     using (var formProcess = new FormProcess(process, arguments, module.WorkingDir, input, useDialogSettings))
     {
         formProcess.ShowDialog(owner);
         return(formProcess.GetOutputString());
     }
 }
Exemple #3
0
            private bool HandleOnExit(ref bool isError, FormProcess form)
            {
                CommandOutput = form.GetOutputString();

                var e = new GitRemoteCommandCompletedEventArgs(this, isError, false);

                if (Completed != null)
                    Completed(form, e);

                isError = e.IsError;

                return e.Handled;
            }
        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.GetOutputString()))

                {
                    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
                    {
                        form.Visible = false;
                        bool pullCompleted;
                        UICommands.StartPullDialog(form, true, out pullCompleted);
                        if (pullCompleted)
                        {
                            form.Visible = true;
                            form.Retry();
                            return true;
                        }
                        form.Visible = true;
                    }
                }
            }

            return false;
        }
Exemple #5
0
 public static string ReadDialog(IWin32Window owner, string process, string arguments, GitModule module, string input, bool useDialogSettings)
 {
     using (var formProcess = new FormProcess(process, arguments, module.WorkingDir, input, useDialogSettings))
     {
         formProcess.ShowDialog(owner);
         return formProcess.GetOutputString();
     }
 }