mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
openFileMerge on "diff with..."
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user