forked from dgrijalva/gitx
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merging krasnyk/stashes branch to soundevolution/svn
Merge branch 'refs/heads/stashes' into testing Conflicts: GitX.xcodeproj/project.pbxproj PBGitHistoryView.xib PBGitSidebarView.xib
- Loading branch information
Showing
88 changed files
with
4,393 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
build | ||
build/revision | ||
._* | ||
*.xcodeproj/ | ||
!*.xcodeproj/project.pbxproj | ||
Nightly.app.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// PBCommandWithParameter.h | ||
// GitX | ||
// | ||
// Created by Tomasz Krasnyk on 10-11-06. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "PBCommand.h" | ||
|
||
|
||
@interface PBCommandWithParameter : PBCommand { | ||
PBCommand *command; | ||
NSString *parameterName; | ||
NSString *parameterDisplayName; | ||
} | ||
@property (nonatomic, retain, readonly) PBCommand *command; | ||
@property (nonatomic, retain, readonly) NSString *parameterName; | ||
@property (nonatomic, retain, readonly) NSString *parameterDisplayName; | ||
|
||
- initWithCommand:(PBCommand *) command parameterName:(NSString *) param parameterDisplayName:(NSString *) paramDisplayName; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// PBCommandWithParameter.m | ||
// GitX | ||
// | ||
// Created by Tomasz Krasnyk on 10-11-06. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "PBCommandWithParameter.h" | ||
#import "PBArgumentPickerController.h" | ||
|
||
|
||
@implementation PBCommandWithParameter | ||
@synthesize command; | ||
@synthesize parameterName; | ||
@synthesize parameterDisplayName; | ||
|
||
- initWithCommand:(PBCommand *) aCommand parameterName:(NSString *) param parameterDisplayName:(NSString *) paramDisplayName { | ||
if (self = [super initWithDisplayName:[aCommand displayName] parameters:nil repository:[aCommand repository]]) { | ||
command = [aCommand retain]; | ||
parameterName = [param retain]; | ||
parameterDisplayName = [paramDisplayName retain]; | ||
} | ||
return self; | ||
} | ||
|
||
- (void) dealloc { | ||
[command release]; | ||
[parameterName release]; | ||
[parameterDisplayName release]; | ||
[super dealloc]; | ||
} | ||
|
||
|
||
- (void) invoke { | ||
PBArgumentPickerController *controller = [[PBArgumentPickerController alloc] initWithCommandWithParameter:self]; | ||
[NSApp beginSheet:[controller window] modalForWindow:[command.repository.windowController window] modalDelegate:controller didEndSelector:nil contextInfo:NULL]; | ||
[controller release]; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// PBOpenDocumentCommand.h | ||
// GitX | ||
// | ||
// Created by Tomasz Krasnyk on 10-11-07. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "PBCommand.h" | ||
|
||
@interface PBOpenDocumentCommand : PBCommand { | ||
NSURL *documentURL; | ||
} | ||
|
||
- (id) initWithDocumentAbsolutePath:(NSString *) path; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// PBOpenDocumentCommand.m | ||
// GitX | ||
// | ||
// Created by Tomasz Krasnyk on 10-11-07. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "PBOpenDocumentCommand.h" | ||
#import "PBRepositoryDocumentController.h" | ||
#import "PBGitRepository.h" | ||
|
||
@implementation PBOpenDocumentCommand | ||
|
||
- (id) initWithDocumentAbsolutePath:(NSString *) path { | ||
if (self = [super initWithDisplayName:@"Open" parameters:nil repository:nil]) { | ||
documentURL = [[NSURL alloc] initWithString:path]; | ||
} | ||
return self; | ||
} | ||
|
||
- (void) invoke { | ||
[[PBRepositoryDocumentController sharedDocumentController] documentForLocation:documentURL]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// PBRemoteCommandFactory.h | ||
// GitX | ||
// | ||
// Created by Tomasz Krasnyk on 10-11-07. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "PBCommandFactory.h" | ||
|
||
|
||
@interface PBRemoteCommandFactory : NSObject<PBCommandFactory> { | ||
|
||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// | ||
// PBRemoteCommandFactory.m | ||
// GitX | ||
// | ||
// Created by Tomasz Krasnyk on 10-11-07. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "PBRemoteCommandFactory.h" | ||
#import "PBOpenDocumentCommand.h" | ||
#import "PBGitSubmodule.h" | ||
#import "PBRevealWithFinderCommand.h" | ||
|
||
|
||
@implementation PBRemoteCommandFactory | ||
|
||
+ (NSArray *) commandsForSubmodule:(PBGitSubmodule *) submodule inRepository:(PBGitRepository *) repository { | ||
NSMutableArray *commands = [[NSMutableArray alloc] init]; | ||
|
||
NSString *repoPath = [repository workingDirectory]; | ||
NSString *path = [repoPath stringByAppendingPathComponent:[submodule path]]; | ||
NSString *submodulePath = [submodule path]; | ||
|
||
if ([submodule submoduleState] == PBGitSubmoduleStateNotInitialized) { | ||
NSArray *params = [NSArray arrayWithObjects:@"submodule", @"init", submodulePath, nil]; | ||
PBCommand *initCmd = [[PBCommand alloc] initWithDisplayName:@"Init" parameters:params repository:repository]; | ||
initCmd.commandTitle = initCmd.displayName; | ||
initCmd.commandDescription = [NSString stringWithFormat:@"Initializing submodule %@", submodulePath]; | ||
[commands addObject:initCmd]; | ||
} | ||
|
||
// update | ||
NSArray *params = [NSArray arrayWithObjects:@"submodule", @"update", submodulePath, nil]; | ||
PBCommand *updateCmd = [[PBCommand alloc] initWithDisplayName:@"Update" parameters:params repository:repository]; | ||
updateCmd.commandTitle = updateCmd.displayName; | ||
updateCmd.commandDescription = [NSString stringWithFormat:@"Updating submodule %@", submodulePath]; | ||
[commands addObject:updateCmd]; | ||
|
||
if ([[submodule submodules] count] > 0) { | ||
// update recursively | ||
NSArray *recursiveUpdate = [NSArray arrayWithObjects:@"submodule", @"update", @"--recursive", submodulePath, nil]; | ||
PBCommand *updateRecursively = [[PBCommand alloc] initWithDisplayName:@"Update recursively" parameters:recursiveUpdate repository:repository]; | ||
updateRecursively.commandTitle = updateRecursively.displayName; | ||
updateRecursively.commandDescription = [NSString stringWithFormat:@"Updating submodule %@ (recursively)", submodulePath]; | ||
[commands addObject:updateRecursively]; | ||
} | ||
|
||
if ([submodule submoduleState] != PBGitSubmoduleStateNotInitialized) { | ||
// open | ||
PBOpenDocumentCommand *command = [[PBOpenDocumentCommand alloc] initWithDocumentAbsolutePath:path]; | ||
command.commandTitle = command.displayName; | ||
command.commandDescription = @"Opening document"; | ||
[commands addObject:command]; | ||
|
||
[commands addObject:[[PBRevealWithFinderCommand alloc] initWithDocumentAbsolutePath:path]]; | ||
} | ||
|
||
return commands; | ||
} | ||
|
||
+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository { | ||
if ([object isKindOfClass:[PBGitSubmodule class]]) { | ||
return [PBRemoteCommandFactory commandsForSubmodule:(id)object inRepository:repository]; | ||
} | ||
return nil; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// PBRevealWithFinder.h | ||
// GitX | ||
// | ||
// Created by Tomasz Krasnyk on 10-11-27. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "PBOpenDocumentCommand.h" | ||
|
||
@interface PBRevealWithFinderCommand : PBOpenDocumentCommand { | ||
|
||
} | ||
|
||
|
||
@end |
Oops, something went wrong.