CommitView: Add context menu to revert changes

This commit is contained in:
Pieter de Bie
2008-10-09 21:03:49 +02:00
parent e659e63fc0
commit 472d36c7f9
7 changed files with 128 additions and 27 deletions
+18
View File
@@ -76,6 +76,24 @@
self.hasUnstagedChanges = YES;
}
- (void) forceRevertChanges
{
[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"checkout", @"--", path, nil]];
self.hasUnstagedChanges = NO;
}
- (void) revertChanges
{
int ret = [[NSAlert alertWithMessageText:@"Revert changes"
defaultButton:nil
alternateButton:@"Cancel"
otherButton:nil
informativeTextWithFormat:@"Are you sure you wish to revert the changes in '%@'?\n\n You cannot undo this operation.", path] runModal];
if (ret == NSAlertDefaultReturn)
[self forceRevertChanges];
}
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
{
return NO;