mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Let the gitx CLI use our RevSpecification
This commit is contained in:
+3
-1
@@ -8,6 +8,7 @@
|
||||
|
||||
#import "PBCLIProxy.h"
|
||||
#import "PBRepositoryDocumentController.h"
|
||||
#import "PBGitRevSpecifier.h"
|
||||
|
||||
@implementation PBCLIProxy
|
||||
@synthesize connection;
|
||||
@@ -32,7 +33,8 @@
|
||||
// I am not familiar with GC though, so perhaps I was doing something wrong.
|
||||
NSURL* url = [NSURL fileURLWithPath:[repositoryPath path]];
|
||||
NSArray* arguments = [NSArray arrayWithArray:args];
|
||||
if (id document = [[PBRepositoryDocumentController sharedDocumentController] openRepositoryAtLocation: url RevParseArgs: arguments]) {
|
||||
PBGitRevSpecifier* rev = [[PBGitRevSpecifier alloc] initWithParameters:arguments];
|
||||
if (id document = [[PBRepositoryDocumentController sharedDocumentController] openRepositoryAtLocation: url RevSpecifier: rev]) {
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
return YES;
|
||||
}
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ extern NSString* PBGitRepositoryErrorDomain;
|
||||
+ (NSURL*)gitDirForURL:(NSURL*)repositoryURL;
|
||||
+ (NSURL*)baseDirForURL:(NSURL*)repositoryURL;
|
||||
|
||||
- (id) initWithURL: (NSURL*) path andArguments:(NSArray*) array;
|
||||
- (id) initWithURL: (NSURL*) path andRevSpecifier:(PBGitRevSpecifier*) rev;
|
||||
|
||||
@property (retain) PBGitRevList* revisionList;
|
||||
@property (assign) NSMutableArray* branches;
|
||||
|
||||
+4
-3
@@ -126,14 +126,15 @@ static NSString* gitPath;
|
||||
return success;
|
||||
}
|
||||
|
||||
- (id) initWithURL: (NSURL*) path andArguments:(NSArray*) array
|
||||
- (id) initWithURL: (NSURL*) path andRevSpecifier:(PBGitRevSpecifier*) rev
|
||||
{
|
||||
self = [self init];
|
||||
NSURL* gitDirURL = [PBGitRepository gitDirForURL:path];
|
||||
[self setFileURL: gitDirURL];
|
||||
[self readRefs];
|
||||
[self readCurrentBranch];
|
||||
revisionList = [[PBGitRevList alloc] initWithRepository:self andRevListParameters:array];
|
||||
[self addBranch: rev];
|
||||
[self selectBranch: rev];
|
||||
revisionList = [[PBGitRevList alloc] initWithRepository:self andRevListParameters: rev];
|
||||
return self;
|
||||
}
|
||||
// The fileURL the document keeps is to the .git dir, but that’s pretty
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBGitRevSpecifier.h"
|
||||
|
||||
|
||||
@interface PBRepositoryDocumentController : NSDocumentController
|
||||
@@ -14,5 +15,5 @@
|
||||
|
||||
}
|
||||
|
||||
- (id) openRepositoryAtLocation:(NSURL*) url RevParseArgs:(NSArray*)args;
|
||||
- (id) openRepositoryAtLocation:(NSURL*) url RevSpecifier:(PBGitRevSpecifier*) rev;
|
||||
@end
|
||||
|
||||
@@ -31,16 +31,16 @@
|
||||
[super noteNewRecentDocumentURL:[PBGitRepository baseDirForURL:url]];
|
||||
}
|
||||
|
||||
- (id) openRepositoryAtLocation:(NSURL*) url RevParseArgs:(NSArray*)args
|
||||
- (id) openRepositoryAtLocation:(NSURL*) url RevSpecifier:(PBGitRevSpecifier*) rev
|
||||
{
|
||||
id document = [self documentForURL:url];
|
||||
if (!document) {
|
||||
document = [[PBGitRepository alloc] initWithURL:url andArguments:args];
|
||||
document = [[PBGitRepository alloc] initWithURL:url andRevSpecifier:rev];
|
||||
[self addDocument:document];
|
||||
[document makeWindowControllers];
|
||||
} else {
|
||||
// TODO: Use a more decent approach for this
|
||||
[document setValue: [[PBGitRevList alloc] initWithRepository:document andRevListParameters: args] forKey:@"revisionList"];
|
||||
[document addBranch: rev];
|
||||
[document selectBranch: rev];
|
||||
}
|
||||
[document showWindows];
|
||||
return document;
|
||||
|
||||
Reference in New Issue
Block a user