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

When cloning a remote using putty, sometimes an error occurs that the fingerprint is not known. This is fixed by trying to connect from the command line, and choose yes when asked for storing the fingerpring. Just a dirty fix...
public SetUrlTryingToConnect ( string url ) : void
url string
Результат void
Пример #1
0
        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.Default;
                branchListLoader.Cancel();

                var dirTo = _NO_TRANSLATE_To.Text;
                if (!dirTo.EndsWith(Settings.PathSeparator.ToString()) && !dirTo.EndsWith(Settings.PathSeparatorWrong.ToString()))
                {
                    dirTo += Settings.PathSeparator.ToString();
                }

                dirTo += _NO_TRANSLATE_NewDirectory.Text;

                Repositories.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
                Repositories.AddMostRecentRepository(dirTo);

                if (!Directory.Exists(dirTo))
                {
                    Directory.CreateDirectory(dirTo);
                }

                var cloneCmd = GitCommandHelpers.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
                                                          CentralRepository.Checked, cbIntializeAllSubmodules.Checked, Branches.Text, null);
                using (var fromProcess = new FormRemoteProcess(Module, Settings.GitCommand, cloneCmd))
                {
                    fromProcess.SetUrlTryingToConnect(_NO_TRANSLATE_From.Text);
                    fromProcess.ShowDialog(this);

                    if (fromProcess.ErrorOccurred() || Module.InTheMiddleOfPatch())
                    {
                        return;
                    }
                }

                if (openedFromProtocolHandler && AskIfNewRepositoryShouldBeOpened(dirTo))
                {
                    Hide();
                    GitUICommands uiCommands = new GitUICommands(dirTo);
                    uiCommands.StartBrowseDialog();
                }
                else if (ShowInTaskbar == false && AskIfNewRepositoryShouldBeOpened(dirTo))
                {
                    if (GitModuleChanged != null)
                    {
                        GitModuleChanged(new GitModule(dirTo));
                    }
                }

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Exception: " + ex.Message, "Clone failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                var dirTo = _NO_TRANSLATE_To.Text;
                if (!dirTo.EndsWith(Settings.PathSeparator.ToString()) && !dirTo.EndsWith(Settings.PathSeparatorWrong.ToString()))
                {
                    dirTo += Settings.PathSeparator.ToString();
                }

                dirTo += _NO_TRANSLATE_NewDirectory.Text;

                Repositories.RepositoryHistory.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
                Repositories.RepositoryHistory.AddMostRecentRepository(dirTo);

                if (!Directory.Exists(dirTo))
                {
                    Directory.CreateDirectory(dirTo);
                }

                var fromProcess =
                    new FormRemoteProcess(Settings.GitCommand,
                                          GitCommandHelpers.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
                                                                     CentralRepository.Checked, Branches.Text, null));
                fromProcess.SetUrlTryingToConnect(_NO_TRANSLATE_From.Text);
                fromProcess.ShowDialog(this);

                if (fromProcess.ErrorOccurred() || Settings.Module.InTheMiddleOfPatch())
                {
                    return;
                }

                if (ShowInTaskbar == false && AskIfNewRepositoryShouldBeOpened(dirTo))
                {
                    Settings.WorkingDir = dirTo;

                    if (File.Exists(Settings.WorkingDir + ".gitmodules") &&
                        AskIfSubmodulesShouldBeInitialized())
                    {
                        GitUICommands.Instance.StartInitSubmodulesRecursiveDialog(this);
                    }
                }
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Exception: " + ex.Message, "Clone failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                if (threadUpdateBranchList != null)
                {
                    Cursor = Cursors.Default;
                    threadUpdateBranchList.Abort();
                }

                var dirTo = _NO_TRANSLATE_To.Text;
                if (!dirTo.EndsWith(Settings.PathSeparator.ToString()) && !dirTo.EndsWith(Settings.PathSeparatorWrong.ToString()))
                    dirTo += Settings.PathSeparator.ToString();

                dirTo += _NO_TRANSLATE_NewDirectory.Text;

                Repositories.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
                Repositories.AddMostRecentRepository(dirTo);

                if (!Directory.Exists(dirTo))
                    Directory.CreateDirectory(dirTo);

                var cloneCmd = GitCommandHelpers.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
                            CentralRepository.Checked, cbIntializeAllSubmodules.Checked, Branches.Text, null);
                var fromProcess = new FormRemoteProcess(Settings.GitCommand, cloneCmd);
                fromProcess.SetUrlTryingToConnect(_NO_TRANSLATE_From.Text);
                fromProcess.ShowDialog(this);

                if (fromProcess.ErrorOccurred() || Settings.Module.InTheMiddleOfPatch())
                    return;

                if (ShowInTaskbar == false && AskIfNewRepositoryShouldBeOpened(dirTo))
                    Settings.WorkingDir = dirTo;
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Exception: " + ex.Message, "Clone failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #4
0
        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                var dirTo = DestinationFolder;

                Repositories.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
                Repositories.AddMostRecentRepository(dirTo);

                if (!Directory.Exists(dirTo))
                    Directory.CreateDirectory(dirTo);

                var fromProcess =
                    new FormRemoteProcess(Settings.GitCommand,
                                    GitCommandHelpers.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
                                                                     CentralRepository.Checked, Branches.Text, null));
                fromProcess.SetUrlTryingToConnect(_NO_TRANSLATE_From.Text);
                fromProcess.ShowDialog(this);

                if (fromProcess.ErrorOccurred || Settings.Module.InTheMiddleOfPatch())
                    return;

                if (ShowInTaskbar == false && AskIfNewRepositoryShouldBeOpened(dirTo))
                {
                    Settings.WorkingDir = dirTo;

                    if (File.Exists(Settings.WorkingDir + ".gitmodules") &&
                        AskIfSubmodulesShouldBeInitialized())
                        GitUICommands.Instance.StartInitSubmodulesRecursiveDialog(this);
                }
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Exception: " + ex.Message, "Clone failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #5
0
        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.Default;
                branchListLoader.Cancel();

                var dirTo = _NO_TRANSLATE_To.Text;
                if (!dirTo.EndsWith(Settings.PathSeparator.ToString()) && !dirTo.EndsWith(Settings.PathSeparatorWrong.ToString()))
                    dirTo += Settings.PathSeparator.ToString();

                dirTo += _NO_TRANSLATE_NewDirectory.Text;

                Repositories.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
                Repositories.AddMostRecentRepository(dirTo);

                if (!Directory.Exists(dirTo))
                    Directory.CreateDirectory(dirTo);

                var cloneCmd = GitCommandHelpers.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
                            CentralRepository.Checked, cbIntializeAllSubmodules.Checked, Branches.Text, null);
                using (var fromProcess = new FormRemoteProcess(Module, Settings.GitCommand, cloneCmd))
                {
                    fromProcess.SetUrlTryingToConnect(_NO_TRANSLATE_From.Text);
                    fromProcess.ShowDialog(this);

                    if (fromProcess.ErrorOccurred() || Module.InTheMiddleOfPatch())
                        return;
                }

                if (openedFromProtocolHandler && AskIfNewRepositoryShouldBeOpened(dirTo))
                {
                    Hide();
                    GitUICommands uiCommands = new GitUICommands(dirTo);
                    uiCommands.StartBrowseDialog();
                }
                else if (ShowInTaskbar == false && AskIfNewRepositoryShouldBeOpened(dirTo))
                    if (GitModuleChanged != null)
                        GitModuleChanged(new GitModule(dirTo));

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Exception: " + ex.Message, "Clone failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #6
0
        private void OkClick(object sender, EventArgs e)
        {
            try
            {
                var dirTo = _NO_TRANSLATE_To.Text;
                if (!dirTo.EndsWith(Settings.PathSeparator.ToString()) && !dirTo.EndsWith(Settings.PathSeparatorWrong.ToString()))
                    dirTo += Settings.PathSeparator.ToString();

                dirTo += _NO_TRANSLATE_NewDirectory.Text;

                Repositories.RepositoryHistory.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
                Repositories.RepositoryHistory.AddMostRecentRepository(dirTo);

                var fromProcess =
                    new FormRemoteProcess(Settings.GitCommand,
                                    GitCommandHelpers.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
                                                                     CentralRepository.Checked, Branches.Text, null));
                fromProcess.SetUrlTryingToConnect(_NO_TRANSLATE_From.Text);
                fromProcess.ShowDialog();

                if (fromProcess.ErrorOccurred() || GitCommandHelpers.InTheMiddleOfPatch())
                    return;

                if (ShowInTaskbar == false && AskIfNewRepositoryShouldBeOpened(dirTo))
                {
                    Settings.WorkingDir = dirTo;

                    if (File.Exists(Settings.WorkingDir + ".gitmodules") &&
                        AskIfSubmodulesShouldBeInitialized())
                        InitSubmodules();
                }
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Exception: " + ex.Message, "Clone failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }