mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Merge branch 'stable'
* stable: Fix many gcc 4.2 compiler warnings GitX.xcodeproj: Quote paths in custom shell scripts Fix compilation with GCC 4.2 IndexController: Temporarily stop tracking when (un)staging IndexController: Add methods to stop tracking the Index ChangesTableView: Remove warning by casting to correct class Conflicts: PBGitCommitController.m
This commit is contained in:
@@ -757,7 +757,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`$TARGET_BUILD_DIR/gitx --git-path`\nVERSION=$(git describe)\nLONG_VERSION=$(echo $VERSION | sed -e \"s/\\-/\\./\" -e \"s/^v//\" -e \"s/-.*//\")\nSHORT_VERSION=$(echo $VERSION | sed -e \"s/\\-.*//\" -e \"s/^v//\")\n\necho -n \"#define LONG_VERSION $LONG_VERSION\n#define SHORT_VERSION $SHORT_VERSION\" > build/revision\ntouch Info.plist";
|
||||
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\nVERSION=$(git describe)\nLONG_VERSION=$(echo $VERSION | sed -e \"s/\\-/\\./\" -e \"s/^v//\" -e \"s/-.*//\")\nSHORT_VERSION=$(echo $VERSION | sed -e \"s/\\-.*//\" -e \"s/^v//\")\n\necho -n \"#define LONG_VERSION $LONG_VERSION\n#define SHORT_VERSION $SHORT_VERSION\" > build/revision\ntouch Info.plist";
|
||||
};
|
||||
F5792DFB0EDB570C001B0C31 /* Compile libgit2 */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -771,7 +771,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`$TARGET_BUILD_DIR/gitx --git-path`\ngit submodule init\ngit submodule update\ncd libgit2\nrm -f libgit2.a\nmake CFLAGS=\"-arch i386 -arch ppc\"\nranlib libgit2.a";
|
||||
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\ngit submodule init\ngit submodule update\ncd libgit2\nrm -f libgit2.a\nmake CFLAGS=\"-arch i386 -arch ppc\"\nranlib libgit2.a";
|
||||
};
|
||||
F5CF04A20EAE696C00D75C81 /* Copy HTML files */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
#import "PBFileChangesTableView.h"
|
||||
#import "PBGitIndexController.h"
|
||||
|
||||
@implementation PBFileChangesTableView
|
||||
|
||||
@@ -14,7 +15,7 @@
|
||||
- (NSMenu *)menuForEvent:(NSEvent *)theEvent
|
||||
{
|
||||
if ([self delegate])
|
||||
return [[self delegate] menuForTable: self];
|
||||
return [(PBGitIndexController *)[self delegate] menuForTable: self];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#import "PBGitCommitController.h"
|
||||
#import "NSFileHandleExt.h"
|
||||
#import "PBChangedFile.h"
|
||||
#import "PBWebChangesController.h"
|
||||
|
||||
@implementation PBGitCommitController
|
||||
|
||||
@@ -33,7 +34,7 @@
|
||||
}
|
||||
- (void) removeView
|
||||
{
|
||||
[webController closeView];
|
||||
[(PBWebChangesController *)webController closeView];
|
||||
[super finalize];
|
||||
}
|
||||
|
||||
@@ -318,11 +319,10 @@
|
||||
if (ret)
|
||||
return [self commitFailedBecause:@"Could not update HEAD"];
|
||||
|
||||
|
||||
if (![repository executeHook:@"post-commit" output:nil])
|
||||
[webController setStateMessage:[NSString stringWithFormat:@"Post-commit hook failed, however, successfully created commit %@", commit]];
|
||||
[(PBWebChangesController *)webController setStateMessage:[NSString stringWithFormat:@"Post-commit hook failed, however, successfully created commit %@", commit]];
|
||||
else
|
||||
[webController setStateMessage:[NSString stringWithFormat:@"Successfully created commit %@", commit]];
|
||||
[(PBWebChangesController *)webController setStateMessage:[NSString stringWithFormat:@"Successfully created commit %@", commit]];
|
||||
|
||||
repository.hasChanged = YES;
|
||||
self.busy--;
|
||||
|
||||
@@ -35,4 +35,6 @@
|
||||
|
||||
- (NSString *) stagedChangesForFile:(PBChangedFile *)file;
|
||||
- (NSString *) unstagedChangesForFile:(PBChangedFile *)file;
|
||||
|
||||
- (NSMenu *) menuForTable:(NSTableView *)table;
|
||||
@end
|
||||
|
||||
+26
-4
@@ -12,6 +12,11 @@
|
||||
|
||||
#define FileChangesTableViewType @"GitFileChangedType"
|
||||
|
||||
@interface PBGitIndexController (PrivateMethods)
|
||||
- (void)stopTrackingIndex;
|
||||
- (void)resumeTrackingIndex;
|
||||
@end
|
||||
|
||||
@implementation PBGitIndexController
|
||||
|
||||
@synthesize contextSize;
|
||||
@@ -49,11 +54,13 @@
|
||||
return;
|
||||
}
|
||||
|
||||
[self stopTrackingIndex];
|
||||
for (PBChangedFile *file in files)
|
||||
{
|
||||
file.hasUnstagedChanges = NO;
|
||||
file.hasCachedChanges = YES;
|
||||
}
|
||||
[self resumeTrackingIndex];
|
||||
}
|
||||
|
||||
- (void) unstageFiles:(NSArray *)files
|
||||
@@ -73,12 +80,14 @@
|
||||
NSLog(@"Error when updating index. Retvalue: %i", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
[self stopTrackingIndex];
|
||||
for (PBChangedFile *file in files)
|
||||
{
|
||||
file.hasUnstagedChanges = YES;
|
||||
file.hasCachedChanges = NO;
|
||||
}
|
||||
[self resumeTrackingIndex];
|
||||
}
|
||||
|
||||
- (void) ignoreFiles:(NSArray *)files
|
||||
@@ -292,7 +301,7 @@
|
||||
|
||||
|
||||
# pragma mark TableView icon delegate
|
||||
- (void)tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(int)rowIndex
|
||||
- (void)tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)rowIndex
|
||||
{
|
||||
id controller = [tableView tag] == 0 ? unstagedFilesController : stagedFilesController;
|
||||
[[tableColumn dataCell] setImage:[[[controller arrangedObjects] objectAtIndex:rowIndex] icon]];
|
||||
@@ -344,7 +353,7 @@ writeRowsWithIndexes:(NSIndexSet *)rowIndexes
|
||||
|
||||
- (NSDragOperation)tableView:(NSTableView*)tableView
|
||||
validateDrop:(id <NSDraggingInfo>)info
|
||||
proposedRow:(int)row
|
||||
proposedRow:(NSInteger)row
|
||||
proposedDropOperation:(NSTableViewDropOperation)operation
|
||||
{
|
||||
if ([info draggingSource] == tableView)
|
||||
@@ -356,7 +365,7 @@ writeRowsWithIndexes:(NSIndexSet *)rowIndexes
|
||||
|
||||
- (BOOL)tableView:(NSTableView *)aTableView
|
||||
acceptDrop:(id <NSDraggingInfo>)info
|
||||
row:(int)row
|
||||
row:(NSInteger)row
|
||||
dropOperation:(NSTableViewDropOperation)operation
|
||||
{
|
||||
NSPasteboard* pboard = [info draggingPasteboard];
|
||||
@@ -386,4 +395,17 @@ writeRowsWithIndexes:(NSIndexSet *)rowIndexes
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark Private Methods
|
||||
- (void)stopTrackingIndex
|
||||
{
|
||||
[stagedFilesController setAutomaticallyRearrangesObjects:NO];
|
||||
[unstagedFilesController setAutomaticallyRearrangesObjects:NO];
|
||||
}
|
||||
- (void)resumeTrackingIndex
|
||||
{
|
||||
[stagedFilesController setAutomaticallyRearrangesObjects:YES];
|
||||
[unstagedFilesController setAutomaticallyRearrangesObjects:YES];
|
||||
[stagedFilesController rearrangeObjects];
|
||||
[unstagedFilesController rearrangeObjects];
|
||||
}
|
||||
@end
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public:
|
||||
d_index = s_colorIndex++;
|
||||
}
|
||||
|
||||
bool PBGitLane::isCommit(git_oid *sha) const
|
||||
bool isCommit(git_oid *sha) const
|
||||
{
|
||||
return !git_oid_cmp(&d_sha, sha);
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
#import "PBRefContextDelegate.h"
|
||||
|
||||
@interface PBGitRevisionCell : NSActionCell {
|
||||
id objectValue;
|
||||
PBGitCommit *objectValue;
|
||||
PBGraphCellInfo *cellInfo;
|
||||
NSTextFieldCell *textCell;
|
||||
IBOutlet PBGitHistoryController *controller;
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(int)selStart length:(int)selLength
|
||||
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength
|
||||
{
|
||||
NSRect textFrame, imageFrame;
|
||||
NSDivideRect (aRect, &imageFrame, &textFrame, 3 + [image size].width, NSMinXEdge);
|
||||
|
||||
+2
-2
@@ -62,11 +62,11 @@
|
||||
- (BOOL) outlineView: (NSOutlineView *)ov
|
||||
isItemExpandable: (id)item { return NO; }
|
||||
|
||||
- (int) outlineView: (NSOutlineView *)ov
|
||||
- (NSInteger) outlineView: (NSOutlineView *)ov
|
||||
numberOfChildrenOfItem:(id)item { return 0; }
|
||||
|
||||
- (id) outlineView: (NSOutlineView *)ov
|
||||
child:(int)index
|
||||
child:(NSInteger)index
|
||||
ofItem:(id)item { return nil; }
|
||||
|
||||
- (id) outlineView: (NSOutlineView *)ov
|
||||
|
||||
+5
-5
@@ -21,12 +21,12 @@
|
||||
[self selectCurrentBranch];
|
||||
}
|
||||
|
||||
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(id)context
|
||||
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
{
|
||||
if ([context isEqualToString: @"branchChange"]) {
|
||||
if ([(NSString *)context isEqualToString: @"branchChange"]) {
|
||||
[self updateBranchMenu];
|
||||
}
|
||||
else if ([context isEqualToString:@"currentBranchChange"]) {
|
||||
else if ([(NSString *)context isEqualToString:@"currentBranchChange"]) {
|
||||
[self selectCurrentBranch];
|
||||
}
|
||||
else {
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
- (NSDragOperation)tableView:(NSTableView*)tv
|
||||
validateDrop:(id <NSDraggingInfo>)info
|
||||
proposedRow:(int)row
|
||||
proposedRow:(NSInteger)row
|
||||
proposedDropOperation:(NSTableViewDropOperation)operation
|
||||
{
|
||||
if (operation == NSTableViewDropAbove)
|
||||
@@ -134,7 +134,7 @@
|
||||
|
||||
- (BOOL)tableView:(NSTableView *)aTableView
|
||||
acceptDrop:(id <NSDraggingInfo>)info
|
||||
row:(int)row
|
||||
row:(NSInteger)row
|
||||
dropOperation:(NSTableViewDropOperation)operation
|
||||
{
|
||||
if (operation != NSTableViewDropOn)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
if ([op runModal] == NSFileHandlingPanelOKButton)
|
||||
{
|
||||
NSString *path = [op filename];
|
||||
NSInteger terminationStatus;
|
||||
int terminationStatus;
|
||||
NSString *result = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"init", @"-q", nil] inDir:path inputString:nil retValue:&terminationStatus];
|
||||
|
||||
if (terminationStatus == 0)
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
[self showDiff:diffController.diff];
|
||||
}
|
||||
|
||||
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(NSString *)context
|
||||
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
{
|
||||
if ([context isEqualToString: @"ChangedDiff"])
|
||||
if ([(NSString *)context isEqualToString: @"ChangedDiff"])
|
||||
[self showDiff:diffController.diff];
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
[self changeContentTo: historyController.webCommit];
|
||||
}
|
||||
|
||||
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(NSString *)context
|
||||
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
{
|
||||
if ([context isEqualToString: @"ChangedCommit"])
|
||||
if ([(NSString *)context isEqualToString: @"ChangedCommit"])
|
||||
[self changeContentTo: historyController.webCommit];
|
||||
else
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
|
||||
Reference in New Issue
Block a user