Skip to content

Commit

Permalink
Display context menu in the history tree to show related commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Pieter de Bie committed Mar 29, 2009
1 parent 69838a4 commit 3c43655
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
1 change: 1 addition & 0 deletions PBGitHistoryController.h
Expand Up @@ -42,6 +42,7 @@
- (IBAction) toggleQuickView: sender;
- (IBAction) openSelectedFile: sender;
- (void) updateQuicklookForce: (BOOL) force;
- (void) showCommitsFromTree:(id) sender;

- (void) copyCommitInfo;

Expand Down
10 changes: 10 additions & 0 deletions PBGitHistoryController.m
Expand Up @@ -202,4 +202,14 @@ - (void) removeView
[super removeView];
}

- (void) showCommitsFromTree:(id) sender
{
NSMutableArray *filePaths = [NSMutableArray arrayWithObjects:@"HEAD", @"--", NULL];
for (PBGitTree *tree in [treeController selectedObjects])
[filePaths addObject:[tree fullPath]];
PBGitRevSpecifier *revSpec = [[PBGitRevSpecifier alloc] initWithParameters:filePaths];

repository.currentBranch = [repository addBranch:revSpec];
}

@end
67 changes: 65 additions & 2 deletions PBGitHistoryView.xib
Expand Up @@ -8,8 +8,9 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="272"/>
<integer value="10"/>
<integer value="236"/>
<integer value="27"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -1493,6 +1494,20 @@
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMenu" id="788594133">
<string key="NSTitle"/>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMenuItem" id="151969960">
<reference key="NSMenu" ref="788594133"/>
<string key="NSTitle">Commits touching paths</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="908677745"/>
<reference key="NSMixedImage" ref="746375230"/>
</object>
</object>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
Expand Down Expand Up @@ -2075,6 +2090,34 @@
</object>
<int key="connectionID">271</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menu</string>
<reference key="source" ref="216928480"/>
<reference key="destination" ref="788594133"/>
</object>
<int key="connectionID">276</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">target: self</string>
<reference key="source" ref="151969960"/>
<reference key="destination" ref="1001"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="151969960"/>
<reference key="NSDestination" ref="1001"/>
<string key="NSLabel">target: self</string>
<string key="NSBinding">target</string>
<string key="NSKeyPath">self</string>
<object class="NSDictionary" key="NSOptions">
<string key="NS.key.0">NSSelectorName</string>
<string key="NS.object.0">showCommitsFromTree:</string>
</object>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">280</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -2690,6 +2733,20 @@
<reference key="object" ref="496187369"/>
<reference key="parent" ref="604026377"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">272</int>
<reference key="object" ref="788594133"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="151969960"/>
</object>
<reference key="parent" ref="1002"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">273</int>
<reference key="object" ref="151969960"/>
<reference key="parent" ref="788594133"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
Expand Down Expand Up @@ -2767,6 +2824,9 @@
<string>27.IBViewIntegration.shadowOffsetHeight</string>
<string>27.IBViewIntegration.shadowOffsetWidth</string>
<string>27.ImportedFromIB2</string>
<string>272.IBEditorWindowLastContentRect</string>
<string>272.IBPluginDependency</string>
<string>273.IBPluginDependency</string>
<string>28.IBPluginDependency</string>
<string>28.IBShouldRemoveOnLegacySave</string>
<string>29.IBPluginDependency</string>
Expand Down Expand Up @@ -2895,6 +2955,9 @@
<reference ref="8"/>
<reference ref="8"/>
<reference ref="9"/>
<string>{{312, 961}, {223, 23}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
Expand Down Expand Up @@ -2964,7 +3027,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">271</int>
<int key="maxID">280</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down

0 comments on commit 3c43655

Please sign in to comment.