public static void ShowMergeDialog (GitRepository repo, bool rebasing) { var dlg = new MergeDialog (repo, rebasing); try { if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) { dlg.Hide (); if (rebasing) { using (ProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Rebasing branch '{0}'...", dlg.SelectedBranch))) { if (dlg.IsRemote) repo.Fetch (monitor, dlg.RemoteName); repo.Rebase (dlg.SelectedBranch, dlg.StageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor); } } else { using (ProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Merging branch '{0}'...", dlg.SelectedBranch))) { if (dlg.IsRemote) repo.Fetch (monitor, dlg.RemoteName); repo.Merge (dlg.SelectedBranch, dlg.StageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor, FastForwardStrategy.NoFastForward); } } } } finally { dlg.Destroy (); dlg.Dispose (); } }
public static void ShowMergeDialog(GitRepository repo, bool rebasing) { MergeDialog dlg = new MergeDialog(repo, rebasing); try { if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok) { dlg.Hide(); if (rebasing) { using (IProgressMonitor monitor = VersionControlService.GetProgressMonitor(GettextCatalog.GetString("Rebasing branch '{0}'...", dlg.SelectedBranch))) { if (dlg.IsRemote) { repo.Fetch(monitor); } repo.Rebase(dlg.SelectedBranch, dlg.StageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor); } } else { using (IProgressMonitor monitor = VersionControlService.GetProgressMonitor(GettextCatalog.GetString("Merging branch '{0}'...", dlg.SelectedBranch))) { if (dlg.IsRemote) { repo.Fetch(monitor); } repo.Merge(dlg.SelectedBranch, dlg.StageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor); } } } } finally { dlg.Destroy(); } }
public static void ShowMergeDialog (GitRepository repo) { MergeDialog dlg = new MergeDialog (repo); try { if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) { dlg.Hide (); using (IProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Merging branch '{0}'...", dlg.SelectedBranch))) { repo.Merge (dlg.SelectedBranch, monitor); } } } finally { dlg.Destroy (); } }
public static void ShowMergeDialog(GitRepository repo, bool rebasing) { MergeDialog dlg = new MergeDialog(repo, rebasing); try { if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok) { dlg.Hide(); using (IProgressMonitor monitor = VersionControlService.GetProgressMonitor(GettextCatalog.GetString("Merging branch '{0}'...", dlg.SelectedBranch))) { repo.Merge(dlg.SelectedBranch, dlg.StageChanges, monitor); } } } finally { dlg.Destroy(); } }
public static void ShowMergeDialog(GitRepository repo, bool rebasing) { var dlg = new MergeDialog(repo, rebasing); try { if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok) { var selectedBranch = dlg.SelectedBranch; var isRemote = dlg.IsRemote; var remoteName = dlg.RemoteName; var stageChanges = dlg.StageChanges; dlg.Hide(); Task.Run((Func <Task>)(async() => { try { if (rebasing) { using (var monitor = VersionControlService.GetProgressMonitor(GettextCatalog.GetString("Rebasing branch '{0}'...", selectedBranch))) { if (isRemote) { await repo.FetchAsync((ProgressMonitor)monitor, (string)remoteName); } await repo.RebaseAsync(selectedBranch, stageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor); } } else { using (var monitor = VersionControlService.GetProgressMonitor(GettextCatalog.GetString("Merging branch '{0}'...", selectedBranch))) { if (isRemote) { await repo.FetchAsync((ProgressMonitor)monitor, (string)remoteName); } await repo.MergeAsync(selectedBranch, stageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor, FastForwardStrategy.NoFastForward); } } } catch (Exception e) { LoggingService.LogError("Error while showing merge dialog.", e); } })); } } finally { dlg.Destroy(); dlg.Dispose(); } }
public static void ShowMergeDialog(GitRepository repo, bool rebasing) { var dlg = new MergeDialog(repo, rebasing); try { if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok) { var selectedBranch = dlg.SelectedBranch; var isRemote = dlg.IsRemote; var remoteName = dlg.RemoteName; var stageChanges = dlg.StageChanges; dlg.Hide(); Task.Run(() => { if (rebasing) { using (ProgressMonitor monitor = VersionControlService.GetProgressMonitor(GettextCatalog.GetString("Rebasing branch '{0}'...", selectedBranch))) { if (isRemote) { repo.Fetch(monitor, remoteName); } repo.Rebase(selectedBranch, stageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor); } } else { using (ProgressMonitor monitor = VersionControlService.GetProgressMonitor(GettextCatalog.GetString("Merging branch '{0}'...", selectedBranch))) { if (isRemote) { repo.Fetch(monitor, remoteName); } repo.Merge(selectedBranch, stageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor, FastForwardStrategy.NoFastForward); } } }); } } finally { dlg.Destroy(); dlg.Dispose(); } }
public static void ShowMergeDialog (GitRepository repo, bool rebasing) { MergeDialog dlg = new MergeDialog (repo, rebasing); try { if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) { dlg.Hide (); if (rebasing) { using (IProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Rebasing branch '{0}'...", dlg.SelectedBranch))) { if (dlg.IsRemote) repo.Fetch (monitor); repo.Rebase (dlg.SelectedBranch, dlg.StageChanges, monitor); } } else { using (IProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Merging branch '{0}'...", dlg.SelectedBranch))) { if (dlg.IsRemote) repo.Fetch (monitor); repo.Merge (dlg.SelectedBranch, dlg.StageChanges, monitor); } } } } finally { dlg.Destroy (); } }