openFileMerge on "diff with..."

This commit is contained in:
German Laullon
2011-04-22 15:47:02 -07:00
parent 09011b82e9
commit cc10bda032
2 changed files with 16 additions and 3 deletions
+7 -1
View File
@@ -10,6 +10,7 @@
#import "PBGitRepository.h"
#import "PBGitCommit.h"
#import "PBGitDefaults.h"
#import "GLFileView.h"
@implementation PBDiffWindowController
@@ -21,6 +22,7 @@
return nil;
diff = aDiff;
return self;
}
@@ -50,8 +52,12 @@
DLog(@"diff failed with retValue: %d for command: '%@' output: '%@'", retValue, [arguments componentsJoinedByString:@" "], diff);
return;
}
diff=[GLFileView parseDiff:diff];
diff=[diff stringByReplacingOccurrencesOfString:@"{SHA_PREV}" withString:[startCommit realSha]];
diff=[diff stringByReplacingOccurrencesOfString:@"{SHA}" withString:[diffCommit realSha]];
PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:[diff copy]];
PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:diff];
[diffController showWindow:nil];
}
+9 -2
View File
@@ -7,7 +7,6 @@
//
#import "PBWebDiffController.h"
#import "GLFileView.h"
@implementation PBWebDiffController
@@ -47,7 +46,15 @@
if ([diff length] == 0)
[script callWebScriptMethod:@"setMessage" withArguments:[NSArray arrayWithObject:@"There are no differences"]];
else
[script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:[GLFileView parseDiff:diff]]];
[script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:diff]];
}
// TODO: need to be refactoring
- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2;
{
NSArray *args=[NSArray arrayWithObjects:@"difftool",@"--no-prompt",@"--tool=opendiff",sha,sha2,file,nil];
[repository handleInWorkDirForArguments:args];
}
@end