diff --git a/English.lproj/PBCreateBranchSheet.xib b/English.lproj/PBCreateBranchSheet.xib new file mode 100644 index 0000000..f02b020 --- /dev/null +++ b/English.lproj/PBCreateBranchSheet.xib @@ -0,0 +1,1052 @@ + + + + 1050 + 10C540 + 732 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 732 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBCreateBranchSheet + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 343}, {480, 167}} + 544736256 + Window + NSWindow + + {1.79769e+308, 1.79769e+308} + {480, 201} + + + 274 + + YES + + + 268 + {{17, 130}, {98, 17}} + + YES + + 68288064 + 272630784 + Create Branch + + LucidaGrande-Bold + 13 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + {{29, 90}, {90, 17}} + + YES + + 68288064 + 71304192 + Branch name: + + LucidaGrande + 13 + 1044 + + + + + + + + + 266 + {{124, 88}, {327, 22}} + + YES + + -1804468671 + 272630784 + topic + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + + + + 289 + {{370, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Create + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 289 + {{274, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Cancel + + + -2038284033 + 129 + + Gw + 200 + 25 + + + + + -2147483380 + {{29, 22}, {226, 17}} + + YES + + 68288064 + 272630784 + Label + + + + + 1 + MSAwIDAAA + + + + + {480, 167} + + + {{0, 0}, {1680, 1028}} + {480, 223} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + window + + + + 31 + + + + delegate + + + + 32 + + + + createBranch: + + + + 33 + + + + closeCreateBranchSheet: + + + + 34 + + + + branchNameField + + + + 45 + + + + errorMessageField + + + + 47 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + + 3 + + + YES + + + + + + 4 + + + + + 5 + + + YES + + + + + + 6 + + + + + 7 + + + YES + + + + + + 8 + + + + + 20 + + + YES + + + + + + 21 + + + + + 22 + + + YES + + + + + + 23 + + + + + 27 + + + YES + + + + + + 28 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 1.windowTemplate.hasMinSize + 1.windowTemplate.minSize + 2.IBPluginDependency + 20.IBPluginDependency + 21.IBPluginDependency + 22.IBPluginDependency + 23.IBPluginDependency + 27.IBPluginDependency + 28.IBPluginDependency + 3.IBPluginDependency + 4.IBPluginDependency + 5.IBPluginDependency + 6.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + + + YES + {{667, 732}, {480, 167}} + com.apple.InterfaceBuilder.CocoaPlugin + {{667, 732}, {480, 167}} + + {196, 240} + {{202, 428}, {480, 270}} + + {480, 201} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 55 + + + + YES + + PBCreateBranchSheet + NSWindowController + + YES + + YES + closeCreateBranchSheet: + createBranch: + + + YES + id + id + + + + YES + + YES + branchNameField + errorMessageField + startingAtMenu + startingAtPopup + + + YES + NSTextField + NSTextField + NSMenu + NSPopUpButton + + + + IBProjectSource + PBCreateBranchSheet.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + 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 + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.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 + 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 + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../GitX.xcodeproj + 3 + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index d8bba5a..01cb711 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -44,6 +44,8 @@ 93CB42C20EAB7B2200530609 /* PBGitDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB42C10EAB7B2200530609 /* PBGitDefaults.m */; }; 93F7857F0EA3ABF100C1F443 /* PBCommitMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */; }; D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; }; + D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; + D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; }; F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; }; F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; }; @@ -208,7 +210,10 @@ 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitMessageView.m; sourceTree = ""; }; 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; - D85B94B710E576B4007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; + D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; + D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; + D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; + D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; @@ -445,6 +450,7 @@ F5E424100EA3E4D60046E362 /* PBDiffWindow.xib */, F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */, F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */, + D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */, 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, ); @@ -487,6 +493,15 @@ name = cli; sourceTree = ""; }; + D82F435F111B9C6D00A25A39 /* Sheets */ = { + isa = PBXGroup; + children = ( + D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */, + D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */, + ); + name = Sheets; + sourceTree = ""; + }; F50A41130EBB872D00208746 /* Widgets */ = { isa = PBXGroup; children = ( @@ -518,6 +533,7 @@ F5B161BB0EAB6E0C005A1DE1 /* Diff */, F5EF8C880E9D498F0050906B /* History */, F5E927F90E883EF600056E75 /* Commit */, + D82F435F111B9C6D00A25A39 /* Sheets */, 77C8280B06725ACE000B614F /* ApplicationController.h */, 77C8280C06725ACE000B614F /* ApplicationController.m */, 93CB42C00EAB7B2200530609 /* PBGitDefaults.h */, @@ -626,7 +642,7 @@ F5AD56770E79B78100EDAAFE /* PBCommitList.h */, F5AD56780E79B78100EDAAFE /* PBCommitList.m */, F5C6F6750E65FE2B00478D97 /* Graphing */, - D85B94B710E576B4007F3C28 /* PBGitRefish.h */, + D85B93F610E51279007F3C28 /* PBGitRefish.h */, F56524EE0E02D45200F03B52 /* PBGitCommit.h */, F56524EF0E02D45200F03B52 /* PBGitCommit.m */, F5C007730E731B48007B84B2 /* PBGitRef.h */, @@ -821,6 +837,7 @@ 47DBDB6A0E94EF6500671A1E /* Preferences.xib in Resources */, 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */, F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */, + D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -940,6 +957,7 @@ F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */, EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */, F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */, + D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1032,6 +1050,14 @@ name = RepositoryWindow.xib; sourceTree = ""; }; + D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D854949310D5C3E20083B917 /* English */, + ); + name = PBCreateBranchSheet.xib; + sourceTree = ""; + }; F5B721C20E05CF7E00AF29DC /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/PBCreateBranchSheet.h b/PBCreateBranchSheet.h new file mode 100644 index 0000000..afded4f --- /dev/null +++ b/PBCreateBranchSheet.h @@ -0,0 +1,37 @@ +// +// PBCreateBranchSheet.h +// GitX +// +// Created by Nathan Kinsinger on 12/13/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBGitRefish.h" + + +@class PBGitRepository; + + +@interface PBCreateBranchSheet : NSWindowController { + PBGitRepository *repository; + id startRefish; + + NSTextField *branchNameField; + NSTextField *errorMessageField; +} + ++ (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo; + + +- (IBAction) createBranch:(id)sender; +- (IBAction) closeCreateBranchSheet:(id)sender; + + +@property (retain) PBGitRepository *repository; +@property (retain) id startRefish; + +@property (assign) IBOutlet NSTextField *branchNameField; +@property (assign) IBOutlet NSTextField *errorMessageField; + +@end diff --git a/PBCreateBranchSheet.m b/PBCreateBranchSheet.m new file mode 100644 index 0000000..d7cb8cf --- /dev/null +++ b/PBCreateBranchSheet.m @@ -0,0 +1,88 @@ +// +// PBCreateBranchSheet.m +// GitX +// +// Created by Nathan Kinsinger on 12/13/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import "PBCreateBranchSheet.h" +#import "PBGitRepository.h" +#import "PBGitCommit.h" +#import "PBGitRef.h" + +@interface PBCreateBranchSheet () + +- (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo; + +@end + + +@implementation PBCreateBranchSheet + + +@synthesize repository; +@synthesize startRefish; + +@synthesize branchNameField; +@synthesize errorMessageField; + + + +#pragma mark - +#pragma mark PBCreateBranchSheet + ++ (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo +{ + PBCreateBranchSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCreateBranchSheet"]; + [sheet beginCreateBranchSheetAtRefish:ref inRepository:repo]; +} + + +- (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo +{ + self.repository = repo; + self.startRefish = ref; + + [self window]; // loads the window (if it wasn't already) + [self.errorMessageField setStringValue:@""]; + + [NSApp beginSheet:[self window] modalForWindow:[self.repository.windowController window] modalDelegate:self didEndSelector:nil contextInfo:NULL]; +} + + + +#pragma mark IBActions + +- (IBAction) createBranch:(id)sender +{ + NSString *name = [self.branchNameField stringValue]; + PBGitRef *ref = [PBGitRef refFromString:[@"refs/heads/" stringByAppendingString:name]]; + + if (![self.repository checkRefFormat:[ref ref]]) { + [self.errorMessageField setStringValue:@"Invalid name"]; + [self.errorMessageField setHidden:NO]; + return; + } + + if ([self.repository refExists:ref]) { + [self.errorMessageField setStringValue:@"Branch already exists"]; + [self.errorMessageField setHidden:NO]; + return; + } + + [self closeCreateBranchSheet:self]; + + [self.repository createBranch:name atRefish:self.startRefish]; +} + + +- (IBAction) closeCreateBranchSheet:(id)sender +{ + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; +} + + + +@end diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index fadb6cd..f45402b 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -51,6 +51,9 @@ - (void)showInFinderAction:(id)sender; - (void)openFilesAction:(id)sender; +// Repository Methods +- (IBAction) createBranch:(id)sender; + - (void) copyCommitInfo; - (BOOL) hasNonlinearPath; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index a9fde36..abb7147 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -11,6 +11,7 @@ #import "PBGitGrapher.h" #import "PBGitRevisionCell.h" #import "PBCommitList.h" +#import "PBCreateBranchSheet.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") @@ -321,4 +322,17 @@ return [sender frame].size.height; } + +#pragma mark Repository Methods + +- (IBAction) createBranch:(id)sender +{ + PBGitRef *currentRef = [repository.currentBranch ref]; + + if (!realCommit || [realCommit hasRef:currentRef]) + [PBCreateBranchSheet beginCreateBranchSheetAtRefish:currentRef inRepository:self.repository]; + else + [PBCreateBranchSheet beginCreateBranchSheetAtRefish:realCommit inRepository:self.repository]; +} + @end diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 68b7789..1bdcd50 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -1,25 +1,35 @@ - + 1050 - 9L31a - 677 - 949.54 - 353.00 + 10C540 + 732 + 1038.25 + 458.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + 732 + 732 + + YES - - YES - com.apple.WebKitIBPlugin - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin YES - + YES @@ -91,7 +101,7 @@ PBWebHistoryController - + 274 YES @@ -106,14 +116,14 @@ 0 LucidaGrande - 1.300000e+01 + 13 1044 YES - 3.200000e+01 + 32 NSImage DetailViewTemplate @@ -175,16 +185,16 @@ YES SubjectColumn - 5.090000e+02 - 4.000000e+01 - 1.000000e+03 + 509 + 40 + 1000 - 75628032 - 0 + 75628096 + 2048 Subject LucidaGrande - 1.100000e+01 + 11 3100 @@ -213,7 +223,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -229,12 +239,12 @@ AuthorColumn - 1.900000e+02 - 4.000000e+01 - 1.000000e+03 + 190 + 40 + 1000 - 75628032 - 0 + 75628096 + 2048 Author @@ -255,12 +265,12 @@ DateColumn - 1.440000e+02 - 1.000000e+01 - 3.402823e+38 + 144 + 10 + 3.4028229999999999e+38 - 75628032 - 0 + 75628096 + 2048 Date @@ -289,12 +299,12 @@ SHAColumn - 6.400000e+01 - 1.000000e+01 - 3.402823e+38 + 64 + 10 + 3.4028229999999999e+38 - 75628032 - 0 + 75628096 + 2048 SHA @@ -315,8 +325,8 @@ YES - 3.000000e+00 - 2.000000e+00 + 3 + 2 6 @@ -327,13 +337,16 @@ MC41AA - 1.700000e+01 + 17 -683671552 + + CommitView 5 15 0 YES + 0 {{0, 17}, {852, 194}} @@ -350,8 +363,8 @@ _doScroller: - 3.700000e+01 - 1.947368e-01 + 37 + 0.19473679999999999 @@ -361,7 +374,7 @@ 1 _doScroller: - 2.193211e-01 + 0.21932109999999999 @@ -409,7 +422,7 @@ 274 YES - + YES Apple HTML pasteboard type Apple PDF pasteboard type @@ -437,7 +450,7 @@ YES - + YES WebKitDefaultFixedFontSize WebKitDefaultFontSize @@ -445,9 +458,9 @@ YES - - - + + + @@ -503,12 +516,12 @@ YES - 1.880000e+02 - 1.600000e+01 - 1.000000e+03 + 188 + 16 + 1000 - 75628032 - 0 + 75628096 + 2048 @@ -531,16 +544,19 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 - 1.700000e+01 + 17 -624951296 + + 4 15 0 YES + 0 {{1, 1}, {191, 186}} @@ -557,18 +573,18 @@ _doScroller: - 9.948186e-01 + 0.9948186 - 256 + -2147483392 {{-100, -100}, {502, 15}} 1 _doScroller: - 4.504505e-03 - 9.980119e-01 + 0.0045045049999999998 + 0.99801189999999995 {208, 188} @@ -593,7 +609,7 @@ 2322 - {543, 112} + {543, 0} @@ -603,7 +619,7 @@ YES - + YES NSFont NSParagraphStyle @@ -612,7 +628,7 @@ YES Monaco - 1.000000e+01 + 10 16 @@ -620,100 +636,100 @@ YES - 0.000000e+00 + 0.0 - 5.600000e+01 + 56 - 1.120000e+02 + 112 - 1.680000e+02 + 168 - 2.240000e+02 + 224 - 2.800000e+02 + 280 - 3.360000e+02 + 336 - 3.920000e+02 + 392 - 4.480000e+02 + 448 - 5.040000e+02 + 504 - 5.600000e+02 + 560 - 6.160000e+02 + 616 - 6.720000e+02 + 672 - 7.280000e+02 + 728 - 7.840000e+02 + 784 - 8.400000e+02 + 840 - 8.960000e+02 + 896 - 9.520000e+02 + 952 - 1.008000e+03 + 1008 - 1.064000e+03 + 1064 - 1.120000e+03 + 1120 - 1.176000e+03 + 1176 - 1.232000e+03 + 1232 - 1.288000e+03 + 1288 - 1.344000e+03 + 1344 - 1.400000e+03 + 1400 - 1.456000e+03 + 1456 - 1.512000e+03 + 1512 - 1.568000e+03 + 1568 - 1.624000e+03 + 1624 - 1.680000e+03 + 1680 - 1.736000e+03 + 1736 @@ -729,16 +745,17 @@ - 5.430000e+02 + 543 1 11233 + 0 + - YES - + YES NSBackgroundColor NSColor @@ -759,10 +776,10 @@ - + YES - + YES NSColor NSUnderline @@ -773,7 +790,7 @@ 1 MCAwIDEAA - + @@ -802,18 +819,18 @@ _doScroller: - 3.003168e-02 + 0.030031680000000002 - 256 + -2147483392 {{-100, -100}, {87, 18}} 1 _doScroller: - 1.000000e+00 - 9.456522e-01 + 1 + 0.94565220000000005 {{209, 0}, {643, 188}} @@ -896,138 +913,11 @@ {852, 432} - NSView PBRefController - - 15 - 2 - {{196, 408}, {346, 102}} - 603979776 - New Branch Sheet - NSWindow - - {1000, 102} - {346, 102} - - - 256 - - YES - - - 266 - {{177, 60}, {149, 22}} - - YES - - -1804468671 - 272630784 - - - topic - - YES - - 6 - System - textBackgroundColor - - - - 6 - System - textColor - - - - - - - 268 - {{17, 62}, {155, 17}} - - YES - - 68288064 - 272630784 - Create a branch named: - - - - - - - - - 289 - {{236, 12}, {96, 32}} - - YES - - 67239424 - 134217728 - Create - - - -2038284033 - 129 - - DQ - 200 - 25 - - - - - 289 - {{140, 12}, {96, 32}} - - YES - - 67239424 - 134217728 - Cancel - - - -2038284033 - 129 - - Gw - 200 - 25 - - - - - 292 - {{17, 22}, {85, 17}} - - YES - - 68288064 - 272630784 - Invalid name - - - - - 1 - MSAwIDAAA - - - - - {346, 102} - - - {{0, 0}, {1680, 1028}} - {346, 124} - {1000, 124} - FFA3AADE-2DC8-4306-B161-4916009C1071 @@ -1041,7 +931,7 @@ 1 YES - + YES 1E431E79-1591-49E7-9E17-49497CA4622A 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 @@ -1073,7 +963,7 @@ YES - 4.000000e+01 + 40 NSImage HistoryViewTemplate @@ -1083,7 +973,7 @@ 0 - 4.000000e+01 + 40 NSImage CommitViewTemplate @@ -1131,15 +1021,20 @@ YES 1 - + + 6 + System + textBackgroundColor + + 130560 0 search + _searchFieldSearch: - 138690815 0 @@ -1154,7 +1049,7 @@ YES YES - + YES AXDescription NSAccessibilityEncodedAttributesValueType @@ -1162,13 +1057,13 @@ YES cancel - + + _searchFieldCancel: - 138690815 0 @@ -1312,7 +1207,7 @@ {134, 25} - {134, 25} + {134, 26} YES YES 0 @@ -1462,7 +1357,7 @@ arrangedObjects.author NSConditionallySetsEditable - + 2 @@ -1498,7 +1393,7 @@ arrangedObjects NSConditionallySetsEditable - + 2 @@ -1614,7 +1509,7 @@ arrangedObjects.path NSConditionallySetsEditable - + 2 @@ -1650,7 +1545,7 @@ arrangedObjects.dateString NSConditionallySetsEditable - + 2 @@ -1746,7 +1641,7 @@ filterPredicate YES - + YES NSDisplayName NSPredicateFormat @@ -1775,7 +1670,7 @@ filterPredicate YES - + YES NSDisplayName NSPredicateFormat @@ -1832,46 +1727,6 @@ 235 - - - performClick: - - - - 248 - - - - newBranchSheet - - - - 249 - - - - newBranchName - - - - 250 - - - - closeSheet: - - - - 252 - - - - saveSheet: - - - - 253 - contextMenuDelegate @@ -1888,14 +1743,6 @@ 260 - - - addRef: - - - - 264 - branchPopUp @@ -1917,7 +1764,7 @@ filterPredicate YES - + YES NSDisplayName NSPredicateFormat @@ -1934,14 +1781,6 @@ 271 - - - errorMessage - - - - 274 - historySplitView @@ -1979,15 +1818,15 @@ selection.textContents YES - + YES NSAllowsEditingMultipleValuesSelection NSConditionallySetsEditable YES - - + + 2 @@ -1995,51 +1834,57 @@ 291 + + + createBranch: + + + + 295 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application 38 - + 39 - + CommitsController 40 - + 46 @@ -2051,7 +1896,7 @@ - + 2 @@ -2242,85 +2087,7 @@ 231 - - - - 236 - - - YES - - - - - - 237 - - - YES - - - - - - - - - - 238 - - - YES - - - - - - 239 - - - YES - - - - - - 240 - - - YES - - - - - - 242 - - - YES - - - - - - 243 - - - - - 245 - - - - - 246 - - - - - 247 - - + 3 @@ -2416,7 +2183,7 @@ - + History Toolbar @@ -2551,20 +2318,6 @@ - - 272 - - - YES - - - - - - 273 - - - 287 @@ -2583,10 +2336,8 @@ YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 10.IBPluginDependency 11.IBPluginDependency @@ -2624,23 +2375,6 @@ 223.IBPluginDependency 224.IBPluginDependency 225.IBPluginDependency - 231.IBPluginDependency - 236.IBEditorWindowLastContentRect - 236.IBWindowTemplateEditedContentRect - 236.NSWindowTemplate.visibleAtLaunch - 236.windowTemplate.hasMaxSize - 236.windowTemplate.hasMinSize - 236.windowTemplate.maxSize - 236.windowTemplate.minSize - 237.IBPluginDependency - 238.IBPluginDependency - 239.IBPluginDependency - 240.IBPluginDependency - 242.IBPluginDependency - 243.IBPluginDependency - 245.IBPluginDependency - 246.IBPluginDependency - 247.IBPluginDependency 261.IBAttributePlaceholdersKey 261.IBPluginDependency 262.IBPluginDependency @@ -2652,8 +2386,6 @@ 27.IBViewIntegration.shadowOffsetHeight 27.IBViewIntegration.shadowOffsetWidth 27.ImportedFromIB2 - 272.IBPluginDependency - 273.IBPluginDependency 28.IBPluginDependency 28.IBShouldRemoveOnLegacySave 287.IBPluginDependency @@ -2681,7 +2413,6 @@ 39.ImportedFromIB2 4.IBAttributePlaceholdersKey 4.IBPluginDependency - 40.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency 47.IBPluginDependency @@ -2698,8 +2429,6 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{312, 366}, {616, 227}} @@ -2729,13 +2458,11 @@ PBCollapsibleSplitView {{312, 577}, {852, 384}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES @@ -2744,23 +2471,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{504, 612}, {346, 102}} - {{504, 612}, {346, 102}} - - - - {1000, 102} - {346, 102} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -2774,49 +2484,44 @@ com.apple.InterfaceBuilder.CocoaPlugin PBCommitList com.apple.InterfaceBuilder.CocoaPlugin - + - - - + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - + PBUnsortableTableHeader com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin PBGitRevisionCell com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + YES - - YES - + YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin {{321, 67}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2833,9 +2538,7 @@ YES - - YES - + YES @@ -2843,15 +2546,13 @@ YES - - YES - + YES - 291 + 295 @@ -2869,7 +2570,7 @@ NSTableView YES - + YES controller webController @@ -2892,8 +2593,9 @@ PBViewController YES - + YES + createBranch: openFilesAction: openSelectedFile: refresh: @@ -2915,11 +2617,12 @@ id id id + id YES - + YES commitController commitList @@ -2958,7 +2661,7 @@ NSActionCell YES - + YES contextMenuDelegate controller @@ -2999,42 +2702,32 @@ NSObject YES - + YES - addRef: changeBranch: - closeSheet: - saveSheet: + createBranch: YES - id NSMenuItem - id - id + PBRefMenuItem YES - + YES branchPopUp commitController commitList - errorMessage historyController - newBranchName - newBranchSheet YES NSPopUpButton NSArrayController PBCommitList - NSTextField PBGitHistoryController - NSTextField - NSWindow @@ -3042,6 +2735,18 @@ PBRefController.h + + PBRefMenuItem + NSMenuItem + + refish + id + + + IBProjectSource + PBRefMenuItem.h + + PBUnsortableTableHeader NSTableHeaderView @@ -3071,7 +2776,7 @@ NSObject YES - + YES repository view @@ -3092,7 +2797,7 @@ PBWebController YES - + YES contextMenuDelegate historyController @@ -3121,8 +2826,755 @@ + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + 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 + + + + NSArrayController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSArrayController.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSManagedObjectContext + NSObject + + IBFrameworkSource + CoreData.framework/Headers/NSManagedObjectContext.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.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 + 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 + + + + NSObjectController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSObjectController.h + + + + NSOutlineView + NSTableView + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSearchField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSearchField.h + + + + NSSearchFieldCell + NSTextFieldCell + + IBFrameworkSource + AppKit.framework/Headers/NSSearchFieldCell.h + + + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTabView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTabView.h + + + + NSTabViewItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTabViewItem.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableHeaderView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTableHeaderView.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSToolbarItem + NSObject + + + + NSTreeController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSTreeController.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSViewController + NSResponder + + view + NSView + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.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 + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES GitX.xcodeproj 3 diff --git a/PBGitRepository.h b/PBGitRepository.h index c8bd680..e78a36f 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -10,6 +10,7 @@ #import "PBGitRevList.h" #import "PBGitRevSpecifier.h" #import "PBGitConfig.h" +#import "PBGitRefish.h" extern NSString* PBGitRepositoryErrorDomain; @@ -28,6 +29,8 @@ extern NSString* PBGitRepositoryErrorDomain; PBGitRevSpecifier *_headRef; // Caching } +- (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; + - (NSFileHandle*) handleForCommand:(NSString*) cmd; - (NSFileHandle*) handleForArguments:(NSArray*) args; - (NSFileHandle *) handleInWorkDirForArguments:(NSArray *)args; diff --git a/PBGitRepository.m b/PBGitRepository.m index 477d15b..a9ed922 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -424,7 +424,29 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return [PBGitBinary path]; return nil; -} +} + +#pragma mark Repository commands + +- (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref +{ + if (!branchName || !ref) + return NO; + + int retValue = 1; + NSArray *arguments = [NSArray arrayWithObjects:@"branch", branchName, [ref refishName], nil]; + NSString *output = [self outputInWorkdirForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *message = [NSString stringWithFormat:@"There was an error creating the branch '%@' at %@ '%@'.", branchName, [ref refishType], [ref shortName]]; + [self.windowController showErrorSheetTitle:@"Create Branch failed!" message:message arguments:arguments output:output]; + return NO; + } + + [self reloadRefs]; + return YES; +} + +#pragma mark low level - (int) returnValueForCommand:(NSString *)cmd { diff --git a/PBRefController.h b/PBRefController.h index 163c996..2c9ed59 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -20,16 +20,10 @@ IBOutlet NSArrayController *commitController; IBOutlet PBCommitList *commitList; - IBOutlet NSWindow *newBranchSheet; - IBOutlet NSTextField *newBranchName; - IBOutlet NSTextField *errorMessage; - IBOutlet NSPopUpButton *branchPopUp; } -- (IBAction)addRef:(id)sender; -- (IBAction)closeSheet:(id) sender; -- (IBAction)saveSheet:(id) sender; +- (void) createBranch:(PBRefMenuItem *)sender; - (NSArray *) menuItemsForRef:(PBGitRef *)ref; - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; diff --git a/PBRefController.m b/PBRefController.m index 63483be..781a656 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -9,6 +9,7 @@ #import "PBRefController.h" #import "PBGitRevisionCell.h" #import "PBRefMenuItem.h" +#import "PBCreateBranchSheet.h" @implementation PBRefController @@ -24,6 +25,7 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([(NSString *)context isEqualToString: @"branchChange"]) { + [commitController rearrangeObjects]; [self updateBranchMenu]; } else if ([(NSString *)context isEqualToString:@"currentBranchChange"]) { @@ -34,6 +36,16 @@ } } + +#pragma mark Create Branch + +- (void) createBranch:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [PBCreateBranchSheet beginCreateBranchSheetAtRefish:refish inRepository:historyController.repository]; +} + + - (void) removeRefSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { if (returnCode == NSAlertDefaultReturn) { @@ -179,53 +191,6 @@ return YES; } -# pragma mark Add ref methods --(void)addRef:(id)sender -{ - [errorMessage setStringValue:@""]; - [NSApp beginSheet:newBranchSheet - modalForWindow:[[historyController view] window] - modalDelegate:NULL - didEndSelector:NULL - contextInfo:NULL]; -} - --(void)saveSheet:(id) sender -{ - NSString *branchName = [@"refs/heads/" stringByAppendingString:[newBranchName stringValue]]; - - if ([[commitController selectedObjects] count] == 0) - return; - - PBGitCommit *commit = [[commitController selectedObjects] objectAtIndex:0]; - - int retValue = 1; - [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"check-ref-format", branchName, nil] retValue:&retValue]; - if (retValue != 0) { - [errorMessage setStringValue:@"Invalid name"]; - return; - } - - retValue = 1; - [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-mCreate branch from GitX", branchName, [commit realSha], @"0000000000000000000000000000000000000000", NULL] retValue:&retValue]; - if (retValue) - { - [errorMessage setStringValue:@"Branch exists"]; - return; - } - [historyController.repository addBranch:[[PBGitRevSpecifier alloc] initWithRef:[PBGitRef refFromString:branchName]]]; - [self closeSheet:sender]; - [commit addRef:[PBGitRef refFromString:branchName]]; - [commitController rearrangeObjects]; -} - --(void)closeSheet:(id) sender -{ - [NSApp endSheet:newBranchSheet]; - [newBranchName setStringValue:@""]; - [newBranchSheet orderOut:self]; -} - # pragma mark Branches menu - (void) updateBranchMenu diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 6740b52..11b5a77 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -46,6 +46,10 @@ // checkout ref NSString *checkoutTitle = [@"Checkout " stringByAppendingString:targetRefName]; [items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkoutRef:) enabled:!isHead]]; + [items addObject:[PBRefMenuItem separatorItem]]; + + // create branch + [items addObject:[PBRefMenuItem itemWithTitle:@"Create branch…" action:@selector(createBranch:) enabled:YES]]; // view tag info if ([ref isTag]) @@ -69,6 +73,8 @@ { NSMutableArray *items = [NSMutableArray array]; + [items addObject:[PBRefMenuItem itemWithTitle:@"Create Branch…" action:@selector(createBranch:) enabled:YES]]; + for (PBRefMenuItem *item in items) { [item setTarget:target]; [item setRefish:commit];