From 2158f1e6c7a54b254318258b50fc359ad51dda24 Mon Sep 17 00:00:00 2001 From: David Catmull Date: Fri, 20 May 2011 21:02:37 -0600 Subject: [PATCH 01/11] start on stash work --- PBGitStashController.h | 30 ++++++++++++++++++++++++++++++ PBGitStashController.m | 24 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 PBGitStashController.h create mode 100644 PBGitStashController.m diff --git a/PBGitStashController.h b/PBGitStashController.h new file mode 100644 index 0000000..0f04e3a --- /dev/null +++ b/PBGitStashController.h @@ -0,0 +1,30 @@ +// +// PBGitHistoryView.h +// GitX +// +// Created by David Catmull on 20-06-11. +// Copyright 2011. All rights reserved. +// + +#import "PBViewController.h" + +// Controls the view displaying a stash diff +@interface PBGitStashController : PBViewController { + IBOutlet id webView; + IBOutlet PBWebStashController *webHistoryController; +} + +- (void) c:(PBGitStash)stash; + +@end + +@interface PBWebStashController : PBWebController { + PBGitStash* currentStash; + NSString* diff; +} + +- (void) changeContentTo:(PBGitStash*)stash; + +@property (readonly) NSString* diff; + +@end diff --git a/PBGitStashController.m b/PBGitStashController.m new file mode 100644 index 0000000..8be1d96 --- /dev/null +++ b/PBGitStashController.m @@ -0,0 +1,24 @@ +// +// PBGitHistoryView.h +// GitX +// +// Created by David Catmull on 20-06-11. +// Copyright 2011. All rights reserved. +// + +#import "PBGitStashController.h" + +@implementation PBGitStashController + + +- (void) awakeFromNib +{ +} + +- (void) showStash:(PBGitStash)stash +{ + // git stash show -p [stash stashSourceMessage] + [webController +} + +@end From 9b0ce4ca3c585e04cc6ed1d9c724b7e724993edb Mon Sep 17 00:00:00 2001 From: David Catmull Date: Thu, 26 May 2011 21:48:17 -0600 Subject: [PATCH 02/11] forward declarations --- Commands/PBCommandFactory.h | 1 + PBGitRepository.h | 8 +++----- PBGitRepository.m | 15 +++++++++------ PBGitSidebarController.m | 1 + PBRefController.m | 1 + 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Commands/PBCommandFactory.h b/Commands/PBCommandFactory.h index 477a52b..1a4a084 100644 --- a/Commands/PBCommandFactory.h +++ b/Commands/PBCommandFactory.h @@ -7,6 +7,7 @@ // #import "PBGitRepository.h" +#import "PBPresentable.h" @protocol PBCommandFactory + (NSArray *) commandsForObject:(id) object repository:(PBGitRepository *) repository; diff --git a/PBGitRepository.h b/PBGitRepository.h index f709f42..62fd7bc 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -12,10 +12,6 @@ #import "PBGitConfig.h" #import "PBGitRefish.h" -#import "PBStashController.h" -#import "PBGitResetController.h" -#import "PBSubmoduleController.h" - extern NSString* PBGitRepositoryErrorDomain; typedef enum branchFilterTypes { kGitXAllBranchesFilter = 0, @@ -42,7 +38,9 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { @class PBGitWindowController; @class PBGitCommit; -@class NSString; +@class PBGitResetController; +@class PBStashController; +@class PBSubmoduleController; @interface PBGitRepository : NSDocument { PBGitHistoryList* revisionList; diff --git a/PBGitRepository.m b/PBGitRepository.m index 90444e1..4011387 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -12,14 +12,17 @@ #import "PBGitBinary.h" #import "NSFileHandleExt.h" -#import "PBEasyPipe.h" -#import "PBGitRef.h" -#import "PBGitRevSpecifier.h" -#import "PBRemoteProgressSheet.h" -#import "PBGitRevList.h" -#import "PBGitDefaults.h" #import "GitXScriptingConstants.h" +#import "PBEasyPipe.h" +#import "PBGitDefaults.h" +#import "PBGitRef.h" +#import "PBGitResetController.h" +#import "PBGitRevList.h" +#import "PBGitRevSpecifier.h" #import "PBHistorySearchController.h" +#import "PBRemoteProgressSheet.h" +#import "PBStashController.h" +#import "PBSubmoduleController.h" #import "PBGitStash.h" #import "PBGitSubmodule.h" diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 276fa75..bb84afa 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -23,6 +23,7 @@ #import "PBCommandMenuItem.h" #import "PBGitStash.h" #import "PBGitSubmodule.h" +#import "PBSubmoduleController.h" static NSString * const kObservingContextStashes = @"stashesChanged"; static NSString * const kObservingContextSubmodules = @"submodulesChanged"; diff --git a/PBRefController.m b/PBRefController.m index 34e22da..c12a18f 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -13,6 +13,7 @@ #import "PBCreateTagSheet.h" #import "PBGitDefaults.h" #import "PBDiffWindowController.h" +#import "PBGitResetController.h" #import "PBArgumentPickerController.h" From 1a35f02ec6d43fad795bf397ea9e262be0a90452 Mon Sep 17 00:00:00 2001 From: David Catmull Date: Fri, 3 Jun 2011 15:51:10 -0600 Subject: [PATCH 03/11] rename & add to project --- GitX.xcodeproj/project.pbxproj | 6 +++++ PBGitStashController.m | 24 ------------------- ...ashController.h => PBStashViewController.h | 12 ++++++---- PBStashViewController.m | 23 ++++++++++++++++++ 4 files changed, 37 insertions(+), 28 deletions(-) delete mode 100644 PBGitStashController.m rename PBGitStashController.h => PBStashViewController.h (61%) create mode 100644 PBStashViewController.m diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 7cb0c81..fc0c36e 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -138,6 +138,7 @@ D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA67114335E8005647F6 /* PBGitSVStageItem.m */; }; D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */; }; D8FDDBF41143F318005647F6 /* AddRemote.png in Resources */ = {isa = PBXBuildFile; fileRef = D8FDDBF31143F318005647F6 /* AddRemote.png */; }; + DDB8FE0113998CE2001A9EE2 /* PBStashViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DDB8FE0013998CE2001A9EE2 /* PBStashViewController.m */; }; F50FE0E30E07BE9600854FCD /* PBGitRevisionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */; }; F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; }; F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */; }; @@ -425,6 +426,8 @@ D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVTagItem.m; sourceTree = ""; }; D8FDDA7311433634005647F6 /* PBSourceViewItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewItems.h; sourceTree = ""; }; D8FDDBF31143F318005647F6 /* AddRemote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddRemote.png; path = Images/AddRemote.png; sourceTree = ""; }; + DDB8FDFF13998CE2001A9EE2 /* PBStashViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBStashViewController.h; sourceTree = ""; }; + DDB8FE0013998CE2001A9EE2 /* PBStashViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBStashViewController.m; sourceTree = ""; }; F50FE0E10E07BE9600854FCD /* PBGitRevisionCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRevisionCell.h; sourceTree = ""; }; F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRevisionCell.m; sourceTree = ""; }; F51308590E0740F2000C8BCD /* PBQLOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLOutlineView.h; sourceTree = ""; }; @@ -939,6 +942,8 @@ 77C8280C06725ACE000B614F /* ApplicationController.m */, 93CB42C00EAB7B2200530609 /* PBGitDefaults.h */, 93CB42C10EAB7B2200530609 /* PBGitDefaults.m */, + DDB8FDFF13998CE2001A9EE2 /* PBStashViewController.h */, + DDB8FE0013998CE2001A9EE2 /* PBStashViewController.m */, F57CC43F0E05E496000472E2 /* PBGitWindowController.h */, F57CC4400E05E496000472E2 /* PBGitWindowController.m */, 911111F60E594F3F00BF76B4 /* PBRepositoryDocumentController.h */, @@ -1447,6 +1452,7 @@ 217FF0BE12A1CB3E00785A65 /* PBRevealWithFinderCommand.m in Sources */, 65D58BC7132D48C2003F7290 /* PBResetSheet.m in Sources */, 31776089133569350025876E /* SearchWebView.m in Sources */, + DDB8FE0113998CE2001A9EE2 /* PBStashViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBGitStashController.m b/PBGitStashController.m deleted file mode 100644 index 8be1d96..0000000 --- a/PBGitStashController.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// PBGitHistoryView.h -// GitX -// -// Created by David Catmull on 20-06-11. -// Copyright 2011. All rights reserved. -// - -#import "PBGitStashController.h" - -@implementation PBGitStashController - - -- (void) awakeFromNib -{ -} - -- (void) showStash:(PBGitStash)stash -{ - // git stash show -p [stash stashSourceMessage] - [webController -} - -@end diff --git a/PBGitStashController.h b/PBStashViewController.h similarity index 61% rename from PBGitStashController.h rename to PBStashViewController.h index 0f04e3a..ca8b334 100644 --- a/PBGitStashController.h +++ b/PBStashViewController.h @@ -1,5 +1,5 @@ // -// PBGitHistoryView.h +// PBStashViewController.h // GitX // // Created by David Catmull on 20-06-11. @@ -7,14 +7,18 @@ // #import "PBViewController.h" +#import "PBWebController.h" + +@class PBGitStash; +@class PBWebStashController; // Controls the view displaying a stash diff -@interface PBGitStashController : PBViewController { +@interface PBStashViewController : PBViewController { IBOutlet id webView; - IBOutlet PBWebStashController *webHistoryController; + IBOutlet PBWebStashController *webController; } -- (void) c:(PBGitStash)stash; +- (void) showStash:(PBGitStash*)stash; @end diff --git a/PBStashViewController.m b/PBStashViewController.m new file mode 100644 index 0000000..e29b746 --- /dev/null +++ b/PBStashViewController.m @@ -0,0 +1,23 @@ +// +// PBStashViewController.h +// GitX +// +// Created by David Catmull on 20-06-11. +// Copyright 2011. All rights reserved. +// + +#import "PBStashViewController.h" +#import "PBGitStash.h" + +@implementation PBStashViewController + +- (void) awakeFromNib +{ +} + +- (void) showStash:(PBGitStash*)stash +{ + [webController changeContentTo:stash]; +} + +@end From f2d875705ec3c2417a0c58c64db91e10f63e0e5a Mon Sep 17 00:00:00 2001 From: David Catmull Date: Fri, 3 Jun 2011 16:41:50 -0600 Subject: [PATCH 04/11] rename again to accommodate implicit nib naming --- GitX.xcodeproj/project.pbxproj | 12 ++++++------ ...ashViewController.h => PBStashContentController.h | 4 ++-- ...ashViewController.m => PBStashContentController.m | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) rename PBStashViewController.h => PBStashContentController.h (86%) rename PBStashViewController.m => PBStashContentController.m (69%) diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index fc0c36e..0617280 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -138,7 +138,7 @@ D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA67114335E8005647F6 /* PBGitSVStageItem.m */; }; D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */; }; D8FDDBF41143F318005647F6 /* AddRemote.png in Resources */ = {isa = PBXBuildFile; fileRef = D8FDDBF31143F318005647F6 /* AddRemote.png */; }; - DDB8FE0113998CE2001A9EE2 /* PBStashViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DDB8FE0013998CE2001A9EE2 /* PBStashViewController.m */; }; + DDB8FE0113998CE2001A9EE2 /* PBStashContentController.m in Sources */ = {isa = PBXBuildFile; fileRef = DDB8FE0013998CE2001A9EE2 /* PBStashContentController.m */; }; F50FE0E30E07BE9600854FCD /* PBGitRevisionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */; }; F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; }; F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */; }; @@ -426,8 +426,8 @@ D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVTagItem.m; sourceTree = ""; }; D8FDDA7311433634005647F6 /* PBSourceViewItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewItems.h; sourceTree = ""; }; D8FDDBF31143F318005647F6 /* AddRemote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddRemote.png; path = Images/AddRemote.png; sourceTree = ""; }; - DDB8FDFF13998CE2001A9EE2 /* PBStashViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBStashViewController.h; sourceTree = ""; }; - DDB8FE0013998CE2001A9EE2 /* PBStashViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBStashViewController.m; sourceTree = ""; }; + DDB8FDFF13998CE2001A9EE2 /* PBStashContentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBStashContentController.h; sourceTree = ""; }; + DDB8FE0013998CE2001A9EE2 /* PBStashContentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBStashContentController.m; sourceTree = ""; }; F50FE0E10E07BE9600854FCD /* PBGitRevisionCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRevisionCell.h; sourceTree = ""; }; F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRevisionCell.m; sourceTree = ""; }; F51308590E0740F2000C8BCD /* PBQLOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLOutlineView.h; sourceTree = ""; }; @@ -942,8 +942,8 @@ 77C8280C06725ACE000B614F /* ApplicationController.m */, 93CB42C00EAB7B2200530609 /* PBGitDefaults.h */, 93CB42C10EAB7B2200530609 /* PBGitDefaults.m */, - DDB8FDFF13998CE2001A9EE2 /* PBStashViewController.h */, - DDB8FE0013998CE2001A9EE2 /* PBStashViewController.m */, + DDB8FDFF13998CE2001A9EE2 /* PBStashContentController.h */, + DDB8FE0013998CE2001A9EE2 /* PBStashContentController.m */, F57CC43F0E05E496000472E2 /* PBGitWindowController.h */, F57CC4400E05E496000472E2 /* PBGitWindowController.m */, 911111F60E594F3F00BF76B4 /* PBRepositoryDocumentController.h */, @@ -1452,7 +1452,7 @@ 217FF0BE12A1CB3E00785A65 /* PBRevealWithFinderCommand.m in Sources */, 65D58BC7132D48C2003F7290 /* PBResetSheet.m in Sources */, 31776089133569350025876E /* SearchWebView.m in Sources */, - DDB8FE0113998CE2001A9EE2 /* PBStashViewController.m in Sources */, + DDB8FE0113998CE2001A9EE2 /* PBStashContentController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBStashViewController.h b/PBStashContentController.h similarity index 86% rename from PBStashViewController.h rename to PBStashContentController.h index ca8b334..f048bac 100644 --- a/PBStashViewController.h +++ b/PBStashContentController.h @@ -1,5 +1,5 @@ // -// PBStashViewController.h +// PBStashContentController.h // GitX // // Created by David Catmull on 20-06-11. @@ -13,7 +13,7 @@ @class PBWebStashController; // Controls the view displaying a stash diff -@interface PBStashViewController : PBViewController { +@interface PBStashContentController : PBViewController { IBOutlet id webView; IBOutlet PBWebStashController *webController; } diff --git a/PBStashViewController.m b/PBStashContentController.m similarity index 69% rename from PBStashViewController.m rename to PBStashContentController.m index e29b746..b2a7a11 100644 --- a/PBStashViewController.m +++ b/PBStashContentController.m @@ -1,15 +1,15 @@ // -// PBStashViewController.h +// PBStashContentController.h // GitX // // Created by David Catmull on 20-06-11. // Copyright 2011. All rights reserved. // -#import "PBStashViewController.h" +#import "PBStashContentController.h" #import "PBGitStash.h" -@implementation PBStashViewController +@implementation PBStashContentController - (void) awakeFromNib { From 94c08dd5bce27d37650f5ac217e51a083bb935d6 Mon Sep 17 00:00:00 2001 From: David Catmull Date: Fri, 3 Jun 2011 16:51:42 -0600 Subject: [PATCH 05/11] stash view xib --- GitX.xcodeproj/project.pbxproj | 4 + PBStashContentView.xib | 1120 ++++++++++++++++++++++++++++++++ 2 files changed, 1124 insertions(+) create mode 100644 PBStashContentView.xib diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 0617280..cf4a4af 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -139,6 +139,7 @@ D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */; }; D8FDDBF41143F318005647F6 /* AddRemote.png in Resources */ = {isa = PBXBuildFile; fileRef = D8FDDBF31143F318005647F6 /* AddRemote.png */; }; DDB8FE0113998CE2001A9EE2 /* PBStashContentController.m in Sources */ = {isa = PBXBuildFile; fileRef = DDB8FE0013998CE2001A9EE2 /* PBStashContentController.m */; }; + DDB8FEC413999C24001A9EE2 /* PBStashContentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = DDB8FEC313999C24001A9EE2 /* PBStashContentView.xib */; }; F50FE0E30E07BE9600854FCD /* PBGitRevisionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */; }; F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; }; F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */; }; @@ -428,6 +429,7 @@ D8FDDBF31143F318005647F6 /* AddRemote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddRemote.png; path = Images/AddRemote.png; sourceTree = ""; }; DDB8FDFF13998CE2001A9EE2 /* PBStashContentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBStashContentController.h; sourceTree = ""; }; DDB8FE0013998CE2001A9EE2 /* PBStashContentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBStashContentController.m; sourceTree = ""; }; + DDB8FEC313999C24001A9EE2 /* PBStashContentView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBStashContentView.xib; sourceTree = ""; }; F50FE0E10E07BE9600854FCD /* PBGitRevisionCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRevisionCell.h; sourceTree = ""; }; F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRevisionCell.m; sourceTree = ""; }; F51308590E0740F2000C8BCD /* PBQLOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLOutlineView.h; sourceTree = ""; }; @@ -768,6 +770,7 @@ F5E424100EA3E4D60046E362 /* PBDiffWindow.xib */, F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */, F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */, + DDB8FEC313999C24001A9EE2 /* PBStashContentView.xib */, D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */, D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */, D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */, @@ -1291,6 +1294,7 @@ 316E7202131EE9C600AFBB36 /* list_Template.png in Resources */, 316E7203131EE9C600AFBB36 /* sidebar_Template.png in Resources */, 65D58BC4132D27A8003F7290 /* PBResetSheet.xib in Resources */, + DDB8FEC413999C24001A9EE2 /* PBStashContentView.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBStashContentView.xib b/PBStashContentView.xib new file mode 100644 index 0000000..2015956 --- /dev/null +++ b/PBStashContentView.xib @@ -0,0 +1,1120 @@ + + + + 1060 + 10J869 + 851 + 1038.35 + 461.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + 851 + 851 + + + + YES + + + + YES + com.apple.WebKitIBPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBStashContentController + + + FirstResponder + + + NSApplication + + + + 274 + + YES + + + 274 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name + + + {480, 272} + + + + + + + + YES + + YES + WebKitDefaultFixedFontSize + WebKitDefaultFontSize + WebKitMinimumFontSize + + + YES + + + + + + + YES + YES + + + {480, 272} + + NSView + + + PBWebStashController + + + + + YES + + + view + + + + 4 + + + + frameLoadDelegate + + + + 5 + + + + policyDelegate + + + + 6 + + + + UIDelegate + + + + 7 + + + + webController + + + + 8 + + + + view + + + + 9 + + + + webView + + + + 10 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + Stash + + + 2 + + + + + 3 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 2.IBPluginDependency + 2.IBViewBoundsToFrameTransform + 3.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{14, 862}, {480, 272}} + com.apple.InterfaceBuilder.CocoaPlugin + {628, 654} + {{357, 416}, {480, 272}} + com.apple.WebKitIBPlugin + + AUJwAABCFAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 10 + + + + YES + + NSApplication + + IBProjectSource + NSApplication+GitXScripting.h + + + + PBGitRepository + NSDocument + + IBProjectSource + PBGitRepository.h + + + + PBStashContentController + PBViewController + + YES + + YES + webController + webView + + + YES + PBWebStashController + id + + + + YES + + YES + webController + webView + + + YES + + webController + PBWebStashController + + + webView + id + + + + + IBProjectSource + PBStashContentController.h + + + + PBViewController + NSViewController + + refresh: + id + + + refresh: + + refresh: + id + + + + IBProjectSource + PBViewController.h + + + + PBWebController + NSObject + + YES + + YES + repository + view + + + YES + PBGitRepository + WebView + + + + YES + + YES + repository + view + + + YES + + repository + PBGitRepository + + + view + WebView + + + + + IBProjectSource + PBWebController.h + + + + PBWebStashController + PBWebController + + + + WebView + + updateSearch: + NSSearchField + + + updateSearch: + + updateSearch: + NSSearchField + + + + IBProjectSource + SearchWebView.h + + + + + YES + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSDocument + NSObject + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocument + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentScripting.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CAAnimation.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CALayer.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CIImageProvider.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSSearchField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSearchField.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSViewController + NSResponder + + view + NSView + + + view + + view + NSView + + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + WebView + NSView + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + + goBack: + id + + + goForward: + id + + + makeTextLarger: + id + + + makeTextSmaller: + id + + + makeTextStandardSize: + id + + + reload: + id + + + reloadFromOrigin: + id + + + stopLoading: + id + + + takeStringURLFrom: + id + + + toggleContinuousSpellChecking: + id + + + toggleSmartInsertDelete: + id + + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + GitX.xcodeproj + 3 + + From e1836bb02ae8b6fde282d78ce441b523649cc283 Mon Sep 17 00:00:00 2001 From: David Catmull Date: Fri, 3 Jun 2011 17:38:05 -0600 Subject: [PATCH 06/11] plug the stuff in, not working yet --- PBGitSidebarController.h | 3 +++ PBGitSidebarController.m | 9 +++++++++ PBStashContentController.h | 11 +++-------- PBStashContentController.m | 35 ++++++++++++++++++++++++++++++++++- 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index 59b9b9d..a2eb106 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -12,6 +12,7 @@ @class PBSourceViewItem; @class PBGitHistoryController; @class PBGitCommitController; +@class PBStashContentController; @interface PBGitSidebarController : PBViewController PROTOCOL_10_6(NSOutlineViewDelegate, NSMenuDelegate){ IBOutlet NSWindow *window; @@ -33,6 +34,7 @@ PBGitHistoryController *historyViewController; PBGitCommitController *commitViewController; + PBStashContentController *stashViewController; } - (void) selectStage; @@ -54,5 +56,6 @@ @property(readonly) NSView *sourceListControlsView; @property(readonly) PBGitHistoryController *historyViewController; @property(readonly) PBGitCommitController *commitViewController; +@property(readonly) PBStashContentController *stashViewController; @end diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index bb84afa..28d8fb0 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -24,6 +24,7 @@ #import "PBGitStash.h" #import "PBGitSubmodule.h" #import "PBSubmoduleController.h" +#import "PBStashContentController.h" static NSString * const kObservingContextStashes = @"stashesChanged"; static NSString * const kObservingContextSubmodules = @"submodulesChanged"; @@ -43,6 +44,7 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged"; @synthesize sourceListControlsView; @synthesize historyViewController; @synthesize commitViewController; +@synthesize stashViewController; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller { @@ -61,6 +63,7 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged"; historyViewController = [[PBGitHistoryController alloc] initWithRepository:repository superController:superController]; commitViewController = [[PBGitCommitController alloc] initWithRepository:repository superController:superController]; + stashViewController = [[PBStashContentController alloc] initWithRepository:repository superController:superController]; [repository addObserver:self forKeyPath:@"refs" options:0 context:@"updateRefs"]; [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"]; @@ -319,6 +322,12 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged"; [PBGitDefaults setShowStageView:YES]; } + if ([item parent] == stashes) { + [superController changeContentController:stashViewController]; + [PBGitDefaults setShowStageView:NO]; + [stashViewController showStash:(PBGitStash*)[(PBGitMenuItem*)item sourceObject]]; + } + [self updateActionMenu]; [self updateRemoteControls]; } diff --git a/PBStashContentController.h b/PBStashContentController.h index f048bac..6254632 100644 --- a/PBStashContentController.h +++ b/PBStashContentController.h @@ -7,7 +7,7 @@ // #import "PBViewController.h" -#import "PBWebController.h" +#import "PBWebHistoryController.h" @class PBGitStash; @class PBWebStashController; @@ -22,13 +22,8 @@ @end -@interface PBWebStashController : PBWebController { - PBGitStash* currentStash; - NSString* diff; +// TODO: This class may not be needed +@interface PBWebStashController : PBWebHistoryController { } -- (void) changeContentTo:(PBGitStash*)stash; - -@property (readonly) NSString* diff; - @end diff --git a/PBStashContentController.m b/PBStashContentController.m index b2a7a11..27d2175 100644 --- a/PBStashContentController.m +++ b/PBStashContentController.m @@ -7,17 +7,50 @@ // #import "PBStashContentController.h" +#import "PBGitDefaults.h" #import "PBGitStash.h" @implementation PBStashContentController - (void) awakeFromNib { + [webController setRepository:repository]; } - (void) showStash:(PBGitStash*)stash { - [webController changeContentTo:stash]; + NSString *stashRef = [NSString stringWithFormat:@"refs/%@", [stash name]]; + NSString *stashSha = [repository shaForRef:[PBGitRef refFromString:stashRef]]; + PBGitCommit *commit = [PBGitCommit commitWithRepository:repository andSha:stashSha]; + + [webController changeContentTo:commit]; } @end + +@implementation PBWebStashController +/* +- (void) changeContentTo:(PBGitStash*)stash +{ + if (stash == nil || !finishedLoading) + return; + + currentStash = stash; + + // TODO: get the stash's SHA and put it in currentSha + + NSString *stashRef = [NSString stringWithFormat:@"refs/%@", [stash name]]; + NSMutableArray *taskArguments = [NSMutableArray arrayWithObjects:@"show", @"--numstat", @"--summary", @"--pretty=raw", stashRef, nil]; + + if (![PBGitDefaults showWhitespaceDifferences]) + [taskArguments insertObject:@"-w" atIndex:1]; + + NSFileHandle *handle = [repository handleForArguments:taskArguments]; + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + + [nc removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil]; + [nc addObserver:self selector:@selector(commitDetailsLoaded:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; + [handle readToEndOfFileInBackgroundAndNotify]; +} +*/ +@end From 800a143b048ccfb6aaa49228fd173d17742ca872 Mon Sep 17 00:00:00 2001 From: David Catmull Date: Sun, 5 Jun 2011 17:11:53 -0600 Subject: [PATCH 07/11] modernize loop --- PBWebHistoryController.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 5d1bd47..70bdb7a 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -88,9 +88,7 @@ NSArray *refsA=[historyController.webCommit refs]; NSString *currentRef=[[[historyController repository] headRef] simpleRef]; NSString *style=@""; - int r=0; - for(r=0;r<[refsA count];r++){ - PBGitRef *ref=[refsA objectAtIndex:r]; + for(PBGitRef *ref in refsA){ if([currentRef isEqualToString:[ref ref]]){ style=[NSString stringWithFormat:@"currentBranch refs %@",[ref type]]; }else{ From 50388f57eb565accdc0527e9c986390304162947 Mon Sep 17 00:00:00 2001 From: David Catmull Date: Sun, 5 Jun 2011 17:16:55 -0600 Subject: [PATCH 08/11] add some spaces --- PBWebHistoryController.m | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 70bdb7a..cbf52ea 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -84,43 +84,43 @@ return; - NSMutableString *refs=[NSMutableString string]; - NSArray *refsA=[historyController.webCommit refs]; - NSString *currentRef=[[[historyController repository] headRef] simpleRef]; - NSString *style=@""; + NSMutableString *refs = [NSMutableString string]; + NSArray *refsA = [historyController.webCommit refs]; + NSString *currentRef = [[[historyController repository] headRef] simpleRef]; + NSString *style = @""; for(PBGitRef *ref in refsA){ if([currentRef isEqualToString:[ref ref]]){ - style=[NSString stringWithFormat:@"currentBranch refs %@",[ref type]]; + style = [NSString stringWithFormat:@"currentBranch refs %@",[ref type]]; }else{ - style=[NSString stringWithFormat:@"refs %@",[ref type]]; + style = [NSString stringWithFormat:@"refs %@",[ref type]]; } [refs appendString:[NSString stringWithFormat:@"%@",style,[ref shortName]]]; } // Header - NSString *header=[self parseHeader:details withRefs:refs]; + NSString *header = [self parseHeader:details withRefs:refs]; // File Stats - NSMutableDictionary *stats=[self parseStats:details]; + NSMutableDictionary *stats = [self parseStats:details]; // File list - NSString *dt=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff-tree", @"--root", @"-r", @"-C90%", @"-M90%", currentSha, nil]]; - NSString *fileList=[GLFileView parseDiffTree:dt withStats:stats]; + NSString *dt = [repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff-tree", @"--root", @"-r", @"-C90%", @"-M90%", currentSha, nil]]; + NSString *fileList = [GLFileView parseDiffTree:dt withStats:stats]; // Diffs list - NSString *d=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff-tree", @"--root", @"--cc", @"-C90%", @"-M90%", currentSha, nil]]; - NSString *diffs=[GLFileView parseDiff:d]; + NSString *d = [repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff-tree", @"--root", @"--cc", @"-C90%", @"-M90%", currentSha, nil]]; + NSString *diffs = [GLFileView parseDiff:d]; - NSString *html=[NSString stringWithFormat:@"%@%@
%@
",header,fileList,diffs]; + NSString *html = [NSString stringWithFormat:@"%@%@
%@
",header,fileList,diffs]; - html=[html stringByReplacingOccurrencesOfString:@"{SHA_PREV}" withString:[NSString stringWithFormat:@"%@^",currentSha]]; - html=[html stringByReplacingOccurrencesOfString:@"{SHA}" withString:currentSha]; + html = [html stringByReplacingOccurrencesOfString:@"{SHA_PREV}" withString:[NSString stringWithFormat:@"%@^",currentSha]]; + html = [html stringByReplacingOccurrencesOfString:@"{SHA}" withString:currentSha]; [[view windowScriptObject] callWebScriptMethod:@"showCommit" withArguments:[NSArray arrayWithObject:html]]; #ifdef DEBUG_BUILD - NSString *dom=[(DOMHTMLElement*)[[[view mainFrame] DOMDocument] documentElement] outerHTML]; - NSString *tmpFile=@"~/tmp/test2.html"; + NSString *dom = [(DOMHTMLElement*)[[[view mainFrame] DOMDocument] documentElement] outerHTML]; + NSString *tmpFile = @"~/tmp/test2.html"; [dom writeToFile:[tmpFile stringByExpandingTildeInPath] atomically:true encoding:NSUTF8StringEncoding error:nil]; #endif } From a2c623bc2cbc6c605826458dbd8aa0b1c145163d Mon Sep 17 00:00:00 2001 From: David Catmull Date: Wed, 8 Jun 2011 15:13:17 -0600 Subject: [PATCH 09/11] delete PBWebStashController --- PBStashContentController.h | 8 +- PBStashContentController.m | 27 ----- PBStashContentView.xib | 199 +++++++++++++++++++++++++++++++++++-- 3 files changed, 194 insertions(+), 40 deletions(-) diff --git a/PBStashContentController.h b/PBStashContentController.h index 6254632..3ec6061 100644 --- a/PBStashContentController.h +++ b/PBStashContentController.h @@ -15,15 +15,9 @@ // Controls the view displaying a stash diff @interface PBStashContentController : PBViewController { IBOutlet id webView; - IBOutlet PBWebStashController *webController; + IBOutlet PBWebHistoryController *webController; } - (void) showStash:(PBGitStash*)stash; @end - -// TODO: This class may not be needed -@interface PBWebStashController : PBWebHistoryController { -} - -@end diff --git a/PBStashContentController.m b/PBStashContentController.m index 27d2175..8432872 100644 --- a/PBStashContentController.m +++ b/PBStashContentController.m @@ -27,30 +27,3 @@ } @end - -@implementation PBWebStashController -/* -- (void) changeContentTo:(PBGitStash*)stash -{ - if (stash == nil || !finishedLoading) - return; - - currentStash = stash; - - // TODO: get the stash's SHA and put it in currentSha - - NSString *stashRef = [NSString stringWithFormat:@"refs/%@", [stash name]]; - NSMutableArray *taskArguments = [NSMutableArray arrayWithObjects:@"show", @"--numstat", @"--summary", @"--pretty=raw", stashRef, nil]; - - if (![PBGitDefaults showWhitespaceDifferences]) - [taskArguments insertObject:@"-w" atIndex:1]; - - NSFileHandle *handle = [repository handleForArguments:taskArguments]; - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - - [nc removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil]; - [nc addObserver:self selector:@selector(commitDetailsLoaded:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; - [handle readToEndOfFileInBackgroundAndNotify]; -} -*/ -@end diff --git a/PBStashContentView.xib b/PBStashContentView.xib index 2015956..5dfb786 100644 --- a/PBStashContentView.xib +++ b/PBStashContentView.xib @@ -109,7 +109,7 @@ NSView - PBWebStashController + PBWebHistoryController @@ -280,6 +280,158 @@ NSApplication+GitXScripting.h + + PBGitHistoryController + PBViewController + + YES + + YES + cherryPick: + createBranch: + createTag: + merge: + openFilesAction: + openSelectedFile: + rebase: + refresh: + selectNext: + selectPrevious: + setBranchFilter: + setDetailedView: + setTreeView: + showAddRemoteSheet: + showCommitsFromTree: + showInFinderAction: + toggleQLPreviewPanel: + updateSearch: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + cherryPick: + createBranch: + createTag: + merge: + openFilesAction: + openSelectedFile: + rebase: + refresh: + selectNext: + selectPrevious: + setBranchFilter: + setDetailedView: + setTreeView: + showAddRemoteSheet: + showCommitsFromTree: + showInFinderAction: + toggleQLPreviewPanel: + updateSearch: + + + YES + + cherryPick: + id + + + createBranch: + id + + + createTag: + id + + + merge: + id + + + openFilesAction: + id + + + openSelectedFile: + id + + + rebase: + id + + + refresh: + id + + + selectNext: + id + + + selectPrevious: + id + + + setBranchFilter: + id + + + setDetailedView: + id + + + setTreeView: + id + + + showAddRemoteSheet: + id + + + showCommitsFromTree: + id + + + showInFinderAction: + id + + + toggleQLPreviewPanel: + id + + + updateSearch: + id + + + + + IBProjectSource + PBGitHistoryController.h + + PBGitRepository NSDocument @@ -300,7 +452,7 @@ YES - PBWebStashController + PBWebHistoryController id @@ -315,7 +467,7 @@ YES webController - PBWebStashController + PBWebHistoryController webView @@ -323,7 +475,7 @@ - + IBProjectSource PBStashContentController.h @@ -388,9 +540,44 @@ - PBWebStashController + PBWebHistoryController PBWebController - + + YES + + YES + contextMenuDelegate + historyController + + + YES + id + PBGitHistoryController + + + + YES + + YES + contextMenuDelegate + historyController + + + YES + + contextMenuDelegate + id + + + historyController + PBGitHistoryController + + + + + IBProjectSource + PBWebHistoryController.h + WebView From e254a4488faeb8933eeef0b946788515ef2d75c4 Mon Sep 17 00:00:00 2001 From: David Catmull Date: Wed, 8 Jun 2011 16:06:49 -0600 Subject: [PATCH 10/11] fix some tabs --- PBGitHistoryController.h | 2 +- PBGitHistoryController.m | 4 ++-- PBGitSidebarController.m | 2 +- PBWebHistoryController.m | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 840d8c4..228e2a2 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -33,7 +33,7 @@ IBOutlet PBCommitList* commitList; IBOutlet NSSplitView *historySplitView; IBOutlet PBWebHistoryController *webHistoryController; - QLPreviewPanel* previewPanel; + QLPreviewPanel* previewPanel; IBOutlet PBHistorySearchController *searchController; IBOutlet GLFileView *fileView; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 4d1a787..64630e1 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -94,7 +94,7 @@ [super awakeFromNib]; - [fileBrowser setDelegate:self]; + [fileBrowser setDelegate:self]; } - (void)updateKeys @@ -414,7 +414,7 @@ - (void) updateView { - [self refresh: nil]; + [self refresh: nil]; [self updateKeys]; } diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 28d8fb0..63290d6 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -325,7 +325,7 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged"; if ([item parent] == stashes) { [superController changeContentController:stashViewController]; [PBGitDefaults setShowStageView:NO]; - [stashViewController showStash:(PBGitStash*)[(PBGitMenuItem*)item sourceObject]]; + [stashViewController showStash:(PBGitStash*)[(PBGitMenuItem*)item sourceObject]]; } [self updateActionMenu]; diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index cbf52ea..f8ccead 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -39,7 +39,7 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if ([(NSString *)context isEqualToString: @"ChangedCommit"]) + if ([(NSString *)context isEqualToString: @"ChangedCommit"]) [self changeContentTo: historyController.webCommit]; else [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; From 0d89d91d00bd310347912765c8315413f968b895 Mon Sep 17 00:00:00 2001 From: David Catmull Date: Wed, 8 Jun 2011 16:35:46 -0600 Subject: [PATCH 11/11] fix initial stash load --- PBGitSidebarController.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 63290d6..14dd91d 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -65,6 +65,8 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged"; commitViewController = [[PBGitCommitController alloc] initWithRepository:repository superController:superController]; stashViewController = [[PBStashContentController alloc] initWithRepository:repository superController:superController]; + [stashViewController loadView]; + [repository addObserver:self forKeyPath:@"refs" options:0 context:@"updateRefs"]; [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"]; [repository addObserver:self forKeyPath:@"branches" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:@"branchesModified"]; @@ -87,6 +89,7 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged"; { [historyViewController closeView]; [commitViewController closeView]; + [stashViewController closeView]; [repository removeObserver:self forKeyPath:@"currentBranch"]; [repository removeObserver:self forKeyPath:@"branches"];