private static bool RevertRevisions (Repository vc, string path, Revision revision, bool test, bool toRevision) { try { if (test) { return (vc.CanRevert (path)); } string question = GettextCatalog.GetString ( "Are you sure you want to revert the selected resources to the revision specified (all local changes will be discarded)?"); if (!toRevision) question = GettextCatalog.GetString ( "Are you sure you want to revert the changes from the revision selected on these resources?"); if (MessageService.AskQuestion (question, GettextCatalog.GetString ("Note: The reversion will occur in your working copy, so you will still need to perform a commit to complete it."), AlertButton.Cancel, AlertButton.Revert) != AlertButton.Revert) return false; new RevertWorker(vc, path, revision, toRevision).Start(); return true; } catch (Exception ex) { if (test) LoggingService.LogError (ex.ToString ()); else MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed.")); return false; } }
private static bool RevertRevisions(Repository vc, string path, Revision revision, bool test, bool toRevision) { try { if (test) { return(vc.CanRevert(path)); } string question = GettextCatalog.GetString( "Are you sure you want to revert the selected resources to the revision specified (all local changes will be discarded)?"); if (!toRevision) { question = GettextCatalog.GetString( "Are you sure you want to revert the changes from the revision selected on these resources?"); } if (MessageService.AskQuestion(question, GettextCatalog.GetString("Note: The reversion will occur in your working copy, so you will still need to perform a commit to complete it."), AlertButton.Cancel, AlertButton.Revert) != AlertButton.Revert) { return(false); } new RevertWorker(vc, path, revision, toRevision).Start(); return(true); } catch (Exception ex) { if (test) { LoggingService.LogError(ex.ToString()); } else { MessageService.ShowException(ex, GettextCatalog.GetString("Version control command failed.")); } return(false); } }