/// <summary>Control rebase process.</summary> /// <param name="control">Type of operation.</param> public Task RebaseAsync(RebaseControl control, IProgress <OperationProgress> progress) { Verify.State.IsFalse(IsDisposed, "Repository is disposed."); switch (control) { case RebaseControl.Abort: if (progress != null) { progress.Report(new OperationProgress(Resources.StrsAbortingRebase.AddEllipsis())); } break; case RebaseControl.Continue: if (progress != null) { progress.Report(new OperationProgress(Resources.StrsContinuingRebase.AddEllipsis())); } break; case RebaseControl.Skip: if (progress != null) { progress.Report(new OperationProgress(Resources.StrsSkippingCommit.AddEllipsis())); } break; default: throw new ArgumentException( "Unknown RebaseControl value: {0}".UseAsFormat(control), "control"); } var block = Monitor.BlockNotifications( RepositoryNotifications.BranchChanged, RepositoryNotifications.Checkout, RepositoryNotifications.WorktreeUpdated, RepositoryNotifications.IndexUpdated); return(Accessor.Rebase.InvokeAsync(new RebaseParameters(control), progress, CancellationToken.None) .ContinueWith( t => { block.Dispose(); _refs.RefreshBranches(); _head.Refresh(); _status.Refresh(); OnStateChanged(); OnUpdated(); TaskUtility.PropagateFaultedStates(t); }, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)); }
/// <summary>Control rebase process.</summary> /// <param name="control">Type of operation.</param> public void Rebase(RebaseControl control) { Verify.State.IsFalse(IsDisposed, "Repository is disposed."); using (Monitor.BlockNotifications( RepositoryNotifications.BranchChanged, RepositoryNotifications.Checkout, RepositoryNotifications.WorktreeUpdated, RepositoryNotifications.IndexUpdated)) { try { Accessor.Rebase.Invoke(new RebaseParameters(control)); } finally { _refs.RefreshBranches(); _head.Refresh(); _status.Refresh(); OnStateChanged(); OnUpdated(); } } }
private void InvokeRebaseControl(RebaseControl control) { var parent = _guiProvider.Environment.MainForm; GuiCommands.Rebase(parent, Repository, control); }
public RebaseParameters(RebaseControl control) { Control = control; }
public static GuiCommandStatus Rebase(IWin32Window parent, Repository repository, RebaseControl control) { Verify.Argument.IsNotNull(repository, nameof(repository)); try { ProgressForm.MonitorTaskAsModalWindow(parent, Resources.StrRebase, p => repository.RebaseAsync(control, p)); return(GuiCommandStatus.Completed); } catch (OperationCanceledException) { return(GuiCommandStatus.Canceled); } catch (GitException exc) { GitterApplication.MessageBoxService.Show( parent, exc.Message, Resources.ErrFailedToRebase, MessageBoxButton.Close, MessageBoxIcon.Error); return(GuiCommandStatus.Faulted); } }
public Command GetRebaseCommand(RebaseControl control) { ICommandArgument arg; switch(control) { case RebaseControl.Abort: arg = RebaseCommand.Abort(); break; case RebaseControl.Continue: arg = RebaseCommand.Continue(); break; case RebaseControl.Skip: arg = RebaseCommand.Skip(); break; default: throw new ArgumentException("control"); } return new RebaseCommand(arg); }
/// <summary>Control rebase process.</summary> /// <param name="control">Type of operation.</param> public Task RebaseAsync(RebaseControl control, IProgress<OperationProgress> progress) { Verify.State.IsFalse(IsDisposed, "Repository is disposed."); switch(control) { case RebaseControl.Abort: if(progress != null) { progress.Report(new OperationProgress(Resources.StrsAbortingRebase.AddEllipsis())); } break; case RebaseControl.Continue: if(progress != null) { progress.Report(new OperationProgress(Resources.StrsContinuingRebase.AddEllipsis())); } break; case RebaseControl.Skip: if(progress != null) { progress.Report(new OperationProgress(Resources.StrsSkippingCommit.AddEllipsis())); } break; default: throw new ArgumentException( "Unknown RebaseControl value: {0}".UseAsFormat(control), "control"); } var block = Monitor.BlockNotifications( RepositoryNotifications.BranchChanged, RepositoryNotifications.Checkout, RepositoryNotifications.WorktreeUpdated, RepositoryNotifications.IndexUpdated); return Accessor.Rebase.InvokeAsync(new RebaseParameters(control), progress, CancellationToken.None) .ContinueWith( t => { block.Dispose(); _refs.RefreshBranches(); _head.Refresh(); _status.Refresh(); OnStateChanged(); OnUpdated(); TaskUtility.PropagateFaultedStates(t); }, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); }
/// <summary>Control rebase process.</summary> /// <param name="control">Type of operation.</param> public void Rebase(RebaseControl control) { Verify.State.IsFalse(IsDisposed, "Repository is disposed."); using(Monitor.BlockNotifications( RepositoryNotifications.BranchChanged, RepositoryNotifications.Checkout, RepositoryNotifications.WorktreeUpdated, RepositoryNotifications.IndexUpdated)) { try { Accessor.Rebase.Invoke(new RebaseParameters(control)); } finally { _refs.RefreshBranches(); _head.Refresh(); _status.Refresh(); OnStateChanged(); OnUpdated(); } } }