mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Add Create Tag
A Create Tag item:
- A new class (and xib) PBCreateTagSheet
- In the Repository menu
- In the contextual menu for commits
PBRefController the method tagInfo:
- renamed to showTagInfoSheet:
- moved it under the Tags mark
This commit is contained in:
+183
-19
@@ -3,12 +3,12 @@
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10C540</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">732</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">759</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.25</string>
|
||||
<string key="IBDocument.HIToolboxVersion">458.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">732</string>
|
||||
<string key="NS.object.0">759</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -648,6 +648,15 @@
|
||||
<string key="NSTitle">Repository</string>
|
||||
<object class="NSMutableArray" key="NSMenuItems">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSMenuItem" id="416044880">
|
||||
<reference key="NSMenu" ref="944982980"/>
|
||||
<string key="NSTitle">Create Tag</string>
|
||||
<string key="NSKeyEquiv">t</string>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="889736156"/>
|
||||
<reference key="NSMixedImage" ref="37108609"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="81071151">
|
||||
<reference key="NSMenu" ref="944982980"/>
|
||||
<string key="NSTitle">Create Branch</string>
|
||||
@@ -675,7 +684,7 @@
|
||||
<reference key="NSOnImage" ref="889736156"/>
|
||||
<reference key="NSMixedImage" ref="37108609"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="600391072">
|
||||
<object class="NSMenuItem" id="950917510">
|
||||
<reference key="NSMenu" ref="944982980"/>
|
||||
<string key="NSTitle">Reveal in Finder</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
@@ -1294,9 +1303,17 @@
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">revealInFinder:</string>
|
||||
<reference key="source" ref="954860085"/>
|
||||
<reference key="destination" ref="600391072"/>
|
||||
<reference key="destination" ref="950917510"/>
|
||||
</object>
|
||||
<int key="connectionID">946</int>
|
||||
<int key="connectionID">948</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">createTag:</string>
|
||||
<reference key="source" ref="954860085"/>
|
||||
<reference key="destination" ref="416044880"/>
|
||||
</object>
|
||||
<int key="connectionID">950</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
@@ -1959,7 +1976,8 @@
|
||||
<reference ref="81071151"/>
|
||||
<reference ref="298101952"/>
|
||||
<reference ref="255856917"/>
|
||||
<reference ref="600391072"/>
|
||||
<reference ref="950917510"/>
|
||||
<reference ref="416044880"/>
|
||||
</object>
|
||||
<reference key="parent" ref="571164270"/>
|
||||
</object>
|
||||
@@ -1979,8 +1997,13 @@
|
||||
<reference key="parent" ref="944982980"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">945</int>
|
||||
<reference key="object" ref="600391072"/>
|
||||
<int key="objectID">947</int>
|
||||
<reference key="object" ref="950917510"/>
|
||||
<reference key="parent" ref="944982980"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">949</int>
|
||||
<reference key="object" ref="416044880"/>
|
||||
<reference key="parent" ref="944982980"/>
|
||||
</object>
|
||||
</object>
|
||||
@@ -2179,7 +2202,8 @@
|
||||
<string>938.IBPluginDependency</string>
|
||||
<string>942.IBPluginDependency</string>
|
||||
<string>943.IBPluginDependency</string>
|
||||
<string>945.IBPluginDependency</string>
|
||||
<string>947.IBPluginDependency</string>
|
||||
<string>949.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -2368,7 +2392,8 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{668, 663}, {192, 73}}</string>
|
||||
<string>{{668, 643}, {192, 93}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -2392,7 +2417,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">946</int>
|
||||
<int key="maxID">950</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -2476,6 +2501,29 @@
|
||||
<string key="minorKey">PBCollapsibleSplitView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBCommitList</string>
|
||||
<string key="superclassName">NSTableView</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>controller</string>
|
||||
<string>webController</string>
|
||||
<string>webView</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>PBGitHistoryController</string>
|
||||
<string>PBWebHistoryController</string>
|
||||
<string>WebView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBCommitList.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBCreateBranchSheet</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
@@ -2496,19 +2544,15 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>branchName</string>
|
||||
<string>errorMessage</string>
|
||||
<string>isTrackingBranch</string>
|
||||
<string>remoteMenu</string>
|
||||
<string>remotePopup</string>
|
||||
<string>branchNameField</string>
|
||||
<string>errorMessageField</string>
|
||||
<string>startRefish</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSTextField</string>
|
||||
<string>NSTextField</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSMenu</string>
|
||||
<string>NSPopUpButton</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
@@ -2516,6 +2560,44 @@
|
||||
<string key="minorKey">PBCreateBranchSheet.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBCreateTagSheet</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>closeCreateTagSheet:</string>
|
||||
<string>createTag:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>errorMessageField</string>
|
||||
<string>tagMessageText</string>
|
||||
<string>tagNameField</string>
|
||||
<string>targetRefish</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSTextField</string>
|
||||
<string>NSTextView</string>
|
||||
<string>NSTextField</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBCreateTagSheet.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBGitCommitController</string>
|
||||
<string key="superclassName">PBViewController</string>
|
||||
@@ -2568,6 +2650,7 @@
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>createBranch:</string>
|
||||
<string>createTag:</string>
|
||||
<string>openFilesAction:</string>
|
||||
<string>openSelectedFile:</string>
|
||||
<string>refresh:</string>
|
||||
@@ -2590,6 +2673,7 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
@@ -2743,6 +2827,64 @@
|
||||
<string key="minorKey">PBNiceSplitView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBRefController</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>changeBranch:</string>
|
||||
<string>copyPatch:</string>
|
||||
<string>copySHA:</string>
|
||||
<string>createBranch:</string>
|
||||
<string>createTag:</string>
|
||||
<string>showTagInfoSheet:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSMenuItem</string>
|
||||
<string>PBRefMenuItem</string>
|
||||
<string>PBRefMenuItem</string>
|
||||
<string>PBRefMenuItem</string>
|
||||
<string>PBRefMenuItem</string>
|
||||
<string>PBRefMenuItem</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>branchPopUp</string>
|
||||
<string>commitController</string>
|
||||
<string>commitList</string>
|
||||
<string>historyController</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSPopUpButton</string>
|
||||
<string>NSArrayController</string>
|
||||
<string>PBCommitList</string>
|
||||
<string>PBGitHistoryController</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBRefController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBRefMenuItem</string>
|
||||
<string key="superclassName">NSMenuItem</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">refish</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBRefMenuItem.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBRepositoryDocumentController</string>
|
||||
<string key="superclassName">NSDocumentController</string>
|
||||
@@ -2817,6 +2959,27 @@
|
||||
<string key="minorKey">PBWebController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBWebHistoryController</string>
|
||||
<string key="superclassName">PBWebController</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>contextMenuDelegate</string>
|
||||
<string>historyController</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>PBGitHistoryController</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBWebHistoryController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -3600,6 +3763,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<integer value="1050" key="NS.object.0"/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,9 @@
|
||||
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 */; };
|
||||
D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; };
|
||||
D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; };
|
||||
D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; };
|
||||
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 */; };
|
||||
@@ -217,6 +219,9 @@
|
||||
D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = "<group>"; };
|
||||
D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = "<group>"; };
|
||||
D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = "<absolute>"; };
|
||||
D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateTagSheet.h; sourceTree = "<group>"; };
|
||||
D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateTagSheet.m; sourceTree = "<group>"; };
|
||||
D8E3B38110DD4E2C001096A3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateTagSheet.xib; sourceTree = "<group>"; };
|
||||
EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = "<group>"; };
|
||||
EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = "<group>"; };
|
||||
F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = "<group>"; };
|
||||
@@ -456,6 +461,7 @@
|
||||
F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */,
|
||||
F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */,
|
||||
D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */,
|
||||
D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */,
|
||||
47DBDB680E94EF6500671A1E /* Preferences.xib */,
|
||||
F569AE920F2CBD7C00C2FFA7 /* Credits.html */,
|
||||
);
|
||||
@@ -503,6 +509,8 @@
|
||||
children = (
|
||||
D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */,
|
||||
D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */,
|
||||
D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */,
|
||||
D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */,
|
||||
);
|
||||
name = Sheets;
|
||||
sourceTree = "<group>";
|
||||
@@ -844,6 +852,7 @@
|
||||
47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */,
|
||||
F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */,
|
||||
D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */,
|
||||
D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -964,6 +973,7 @@
|
||||
EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */,
|
||||
F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */,
|
||||
D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */,
|
||||
D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -1064,6 +1074,14 @@
|
||||
name = PBCreateBranchSheet.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
D8E3B38110DD4E2C001096A3 /* English */,
|
||||
);
|
||||
name = PBCreateTagSheet.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F5B721C20E05CF7E00AF29DC /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// PBCreateTagSheet.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Nathan Kinsinger on 12/18/09.
|
||||
// Copyright 2009 Nathan Kinsinger. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBGitRefish.h"
|
||||
|
||||
|
||||
@class PBGitRepository;
|
||||
|
||||
|
||||
@interface PBCreateTagSheet : NSWindowController {
|
||||
PBGitRepository *repository;
|
||||
id <PBGitRefish> targetRefish;
|
||||
|
||||
NSTextField *tagNameField;
|
||||
NSTextView *tagMessageText;
|
||||
NSTextField *errorMessageField;
|
||||
}
|
||||
|
||||
+ (void) beginCreateTagSheetAtRefish:(id <PBGitRefish>)refish inRepository:(PBGitRepository *)repo;
|
||||
|
||||
- (IBAction) createTag:(id)sender;
|
||||
- (IBAction) closeCreateTagSheet:(id)sender;
|
||||
|
||||
|
||||
@property (retain) PBGitRepository *repository;
|
||||
@property (retain) id <PBGitRefish> targetRefish;
|
||||
|
||||
@property (assign) IBOutlet NSTextField *tagNameField;
|
||||
@property (assign) IBOutlet NSTextView *tagMessageText;
|
||||
@property (assign) IBOutlet NSTextField *errorMessageField;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// PBCreateTagSheet.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Nathan Kinsinger on 12/18/09.
|
||||
// Copyright 2009 Nathan Kinsinger. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBCreateTagSheet.h"
|
||||
#import "PBGitRepository.h"
|
||||
#import "PBGitCommit.h"
|
||||
|
||||
|
||||
@interface PBCreateTagSheet ()
|
||||
|
||||
- (void) beginCreateTagSheetAtRefish:(id <PBGitRefish>)refish inRepository:(PBGitRepository *)repo;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation PBCreateTagSheet
|
||||
|
||||
@synthesize repository;
|
||||
@synthesize targetRefish;
|
||||
|
||||
@synthesize tagNameField;
|
||||
@synthesize tagMessageText;
|
||||
@synthesize errorMessageField;
|
||||
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark PBCreateTagSheet
|
||||
|
||||
+ (void) beginCreateTagSheetAtRefish:(id <PBGitRefish>)refish inRepository:(PBGitRepository *)repo
|
||||
{
|
||||
PBCreateTagSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCreateTagSheet"];
|
||||
[sheet beginCreateTagSheetAtRefish:refish inRepository:repo];
|
||||
}
|
||||
|
||||
|
||||
- (void) beginCreateTagSheetAtRefish:(id <PBGitRefish>)refish inRepository:(PBGitRepository *)repo
|
||||
{
|
||||
self.repository = repo;
|
||||
self.targetRefish = refish;
|
||||
|
||||
[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) createTag:(id)sender
|
||||
{
|
||||
NSString *tagName = [self.tagNameField stringValue];
|
||||
[self.errorMessageField setHidden:YES];
|
||||
|
||||
NSString *refName = [@"refs/tags/" stringByAppendingString:tagName];
|
||||
if (![self.repository checkRefFormat:refName]) {
|
||||
[self.errorMessageField setStringValue:@"Invalid name"];
|
||||
[self.errorMessageField setHidden:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
for (PBGitRevSpecifier *rev in self.repository.branches) {
|
||||
NSString *name = [[rev ref] tagName];
|
||||
if ([tagName isEqualToString:name]) {
|
||||
[self.errorMessageField setStringValue:@"Tag already exists"];
|
||||
[self.errorMessageField setHidden:NO];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[self closeCreateTagSheet:sender];
|
||||
|
||||
NSString *message = [self.tagMessageText string];
|
||||
[self.repository createTag:tagName message:message atRefish:self.targetRefish];
|
||||
}
|
||||
|
||||
|
||||
- (IBAction) closeCreateTagSheet:(id)sender
|
||||
{
|
||||
[NSApp endSheet:[self window]];
|
||||
[[self window] orderOut:self];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
@@ -53,6 +53,7 @@
|
||||
|
||||
// Repository Methods
|
||||
- (IBAction) createBranch:(id)sender;
|
||||
- (IBAction) createTag:(id)sender;
|
||||
|
||||
- (void) copyCommitInfo;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#import "PBGitRevisionCell.h"
|
||||
#import "PBCommitList.h"
|
||||
#import "PBCreateBranchSheet.h"
|
||||
#import "PBCreateTagSheet.h"
|
||||
#define QLPreviewPanel NSClassFromString(@"QLPreviewPanel")
|
||||
|
||||
|
||||
@@ -335,4 +336,12 @@
|
||||
[PBCreateBranchSheet beginCreateBranchSheetAtRefish:realCommit inRepository:self.repository];
|
||||
}
|
||||
|
||||
- (IBAction) createTag:(id)sender
|
||||
{
|
||||
if (!realCommit)
|
||||
[PBCreateTagSheet beginCreateTagSheetAtRefish:[repository.currentBranch ref] inRepository:repository];
|
||||
else
|
||||
[PBCreateTagSheet beginCreateTagSheetAtRefish:realCommit inRepository:repository];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -30,6 +30,7 @@ extern NSString* PBGitRepositoryErrorDomain;
|
||||
}
|
||||
|
||||
- (BOOL) createBranch:(NSString *)branchName atRefish:(id <PBGitRefish>)ref;
|
||||
- (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id <PBGitRefish>)commitSHA;
|
||||
|
||||
- (NSFileHandle*) handleForCommand:(NSString*) cmd;
|
||||
- (NSFileHandle*) handleForArguments:(NSArray*) args;
|
||||
|
||||
@@ -446,6 +446,41 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id <PBGitRefish>)target
|
||||
{
|
||||
if (!tagName)
|
||||
return NO;
|
||||
|
||||
NSMutableArray *arguments = [NSMutableArray arrayWithObject:@"tag"];
|
||||
|
||||
// if there is a message then make this an annotated tag
|
||||
if (message && ![message isEqualToString:@""] && ([message length] > 3)) {
|
||||
[arguments addObject:@"-a"];
|
||||
[arguments addObject:[@"-m" stringByAppendingString:message]];
|
||||
}
|
||||
|
||||
[arguments addObject:tagName];
|
||||
|
||||
// if no refish then git will add it to HEAD
|
||||
if (target)
|
||||
[arguments addObject:[target refishName]];
|
||||
|
||||
int retValue = 1;
|
||||
NSString *output = [self outputInWorkdirForArguments:arguments retValue:&retValue];
|
||||
if (retValue) {
|
||||
NSString *targetName = @"HEAD";
|
||||
if (target)
|
||||
targetName = [NSString stringWithFormat:@"%@ '%@'", [target refishType], [target shortName]];
|
||||
NSString *message = [NSString stringWithFormat:@"There was an error creating the tag '%@' at %@.", tagName, targetName];
|
||||
[self.windowController showErrorSheetTitle:@"Create Tag failed!" message:message arguments:arguments output:output];
|
||||
return NO;
|
||||
}
|
||||
|
||||
[self reloadRefs];
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark low level
|
||||
|
||||
- (int) returnValueForCommand:(NSString *)cmd
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
- (void) createBranch:(PBRefMenuItem *)sender;
|
||||
- (void) copySHA:(PBRefMenuItem *)sender;
|
||||
- (void) copyPatch:(PBRefMenuItem *)sender;
|
||||
- (void) createTag:(PBRefMenuItem *)sender;
|
||||
- (void) showTagInfoSheet:(PBRefMenuItem *)sender;
|
||||
|
||||
- (NSArray *) menuItemsForRef:(PBGitRef *)ref;
|
||||
- (NSArray *) menuItemsForCommit:(PBGitCommit *)commit;
|
||||
|
||||
+26
-12
@@ -10,6 +10,7 @@
|
||||
#import "PBGitRevisionCell.h"
|
||||
#import "PBRefMenuItem.h"
|
||||
#import "PBCreateBranchSheet.h"
|
||||
#import "PBCreateTagSheet.h"
|
||||
|
||||
@implementation PBRefController
|
||||
|
||||
@@ -75,6 +76,31 @@
|
||||
}
|
||||
|
||||
|
||||
#pragma mark Tags
|
||||
|
||||
- (void) createTag:(PBRefMenuItem *)sender
|
||||
{
|
||||
id <PBGitRefish> refish = [sender refish];
|
||||
[PBCreateTagSheet beginCreateTagSheetAtRefish:refish inRepository:historyController.repository];
|
||||
}
|
||||
|
||||
- (void) showTagInfoSheet:(PBRefMenuItem *)sender
|
||||
{
|
||||
if ([[sender refish] refishType] != kGitXTagType)
|
||||
return;
|
||||
|
||||
NSString *tagName = [(PBGitRef *)[sender refish] tagName];
|
||||
|
||||
int retValue = 1;
|
||||
NSArray *args = [NSArray arrayWithObjects:@"tag", @"-n50", @"-l", tagName, nil];
|
||||
NSString *info = [historyController.repository outputInWorkdirForArguments:args retValue:&retValue];
|
||||
if (!retValue) {
|
||||
NSString *message = [NSString stringWithFormat:@"Info for tag: %@", tagName];
|
||||
[historyController.repository.windowController showMessageSheet:message infoText:info];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void) removeRefSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
|
||||
{
|
||||
if (returnCode == NSAlertDefaultReturn) {
|
||||
@@ -111,18 +137,6 @@
|
||||
[commitController rearrangeObjects];
|
||||
}
|
||||
|
||||
- (void) tagInfo:(PBRefMenuItem *)sender
|
||||
{
|
||||
NSString *message = [NSString stringWithFormat:@"Info for tag: %@", [[sender refish] shortName]];
|
||||
|
||||
int ret = 1;
|
||||
NSString *info = [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"tag", @"-n50", @"-l", [[sender refish] shortName], nil] retValue: &ret];
|
||||
|
||||
if (!ret) {
|
||||
[[historyController.repository windowController] showMessageSheet:message infoText:info];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#pragma mark Contextual menus
|
||||
|
||||
|
||||
+5
-1
@@ -51,9 +51,12 @@
|
||||
// create branch
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"Create branch…" action:@selector(createBranch:) enabled:YES]];
|
||||
|
||||
// create tag
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]];
|
||||
|
||||
// view tag info
|
||||
if ([ref isTag])
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"View tag info" action:@selector(tagInfo:) enabled:YES]];
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"View tag info…" action:@selector(showTagInfoSheet:) enabled:YES]];
|
||||
|
||||
// delete ref
|
||||
[items addObject:[PBRefMenuItem separatorItem]];
|
||||
@@ -74,6 +77,7 @@
|
||||
NSMutableArray *items = [NSMutableArray array];
|
||||
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"Create Branch…" action:@selector(createBranch:) enabled:YES]];
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]];
|
||||
[items addObject:[PBRefMenuItem separatorItem]];
|
||||
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"Copy SHA" action:@selector(copySHA:) enabled:YES]];
|
||||
|
||||
Reference in New Issue
Block a user