Skip to content

Commit e08a24f

Browse files
committed
Merge branch 'experimental' of https://github.com/laullon/gitx into experimental
Conflicts: PBGitRepository.h PBGitSidebarController.m PBSourceViewCell.h PBSourceViewCell.m
2 parents 2de41fd + d02caf4 commit e08a24f

File tree

3 files changed

+37
-40
lines changed

3 files changed

+37
-40
lines changed

PBGitSidebarController.m

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGit
4848
self = [super initWithRepository:theRepository superController:controller];
4949
[sourceView setDelegate:self];
5050
items = [NSMutableArray array];
51-
51+
5252
return self;
5353
}
5454

@@ -57,19 +57,19 @@ - (void)awakeFromNib
5757
[super awakeFromNib];
5858
window.contentView = self.view;
5959
[self populateList];
60-
60+
6161
historyViewController = [[PBGitHistoryController alloc] initWithRepository:repository superController:superController];
6262
commitViewController = [[PBGitCommitController alloc] initWithRepository:repository superController:superController];
63-
63+
6464
[repository addObserver:self forKeyPath:@"refs" options:0 context:@"updateRefs"];
6565
[repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"];
6666
[repository addObserver:self forKeyPath:@"branches" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:@"branchesModified"];
6767
[repository addObserver:self forKeyPath:@"stashController.stashes" options:NSKeyValueObservingOptionNew context:kObservingContextStashes];
6868
[repository addObserver:self forKeyPath:@"submoduleController.submodules" options:NSKeyValueObservingOptionNew context:kObservingContextSubmodules];
69-
70-
69+
70+
7171
[self menuNeedsUpdate:[actionButton menu]];
72-
72+
7373
if ([PBGitDefaults showStageView])
7474
[self selectStage];
7575
else
@@ -83,12 +83,12 @@ - (void)closeView
8383
{
8484
[historyViewController closeView];
8585
[commitViewController closeView];
86-
86+
8787
[repository removeObserver:self forKeyPath:@"currentBranch"];
8888
[repository removeObserver:self forKeyPath:@"branches"];
8989
[repository removeObserver:self forKeyPath:@"stashController.stashes"];
9090
[repository removeObserver:self forKeyPath:@"submoduleController.submodules"];
91-
91+
9292
[super closeView];
9393
}
9494

@@ -99,7 +99,7 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(
9999
[self selectCurrentBranch];
100100
}else if ([@"branchesModified" isEqualToString:context]) {
101101
NSInteger changeKind = [(NSNumber *)[change objectForKey:NSKeyValueChangeKindKey] intValue];
102-
102+
103103
if (changeKind == NSKeyValueChangeInsertion) {
104104
NSArray *newRevSpecs = [change objectForKey:NSKeyValueChangeNewKey];
105105
for (PBGitRevSpecifier *rev in newRevSpecs) {
@@ -195,7 +195,7 @@ - (PBSourceViewItem *) selectedItem
195195
{
196196
NSInteger index = [sourceView selectedRow];
197197
PBSourceViewItem *item = [sourceView itemAtRow:index];
198-
198+
199199
return item;
200200
}
201201

@@ -261,7 +261,7 @@ - (void)addRevSpec:(PBGitRevSpecifier *)rev
261261
[sourceView reloadData];
262262
return;
263263
}
264-
264+
265265
NSArray *pathComponents = [[rev simpleRef] componentsSeparatedByString:@"/"];
266266
if ([pathComponents count] < 2)
267267
[branches addChild:[PBSourceViewItem itemWithRevSpec:rev]];
@@ -271,17 +271,17 @@ - (void)addRevSpec:(PBGitRevSpecifier *)rev
271271
[tags addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]];
272272
else if ([[rev simpleRef] hasPrefix:@"refs/remotes/"])
273273
[remotes addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]];
274-
274+
275275
[sourceView reloadData];
276276
}
277277

278278
- (void) removeRevSpec:(PBGitRevSpecifier *)rev
279279
{
280280
PBSourceViewItem *item = [self itemForRev:rev];
281-
281+
282282
if (!item)
283283
return;
284-
284+
285285
PBSourceViewItem *parent = item.parent;
286286
[parent removeChild:item];
287287
[sourceView reloadData];
@@ -298,19 +298,19 @@ - (void)outlineViewSelectionDidChange:(NSNotification *)notification
298298
{
299299
NSInteger index = [sourceView selectedRow];
300300
PBSourceViewItem *item = [sourceView itemAtRow:index];
301-
301+
302302
if ([item revSpecifier]) {
303303
if (![repository.currentBranch isEqual:[item revSpecifier]])
304304
repository.currentBranch = [item revSpecifier];
305305
[superController changeContentController:historyViewController];
306306
[PBGitDefaults setShowStageView:NO];
307307
}
308-
308+
309309
if (item == stage) {
310310
[superController changeContentController:commitViewController];
311311
[PBGitDefaults setShowStageView:YES];
312312
}
313-
313+
314314
[self updateActionMenu];
315315
[self updateRemoteControls];
316316
}
@@ -358,7 +358,7 @@ - (void)populateList
358358
PBSourceViewItem *project = [PBSourceViewItem groupItemWithTitle:[repository projectName]];
359359
project.showsActionButton = YES;
360360
project.isUncollapsible = YES;
361-
361+
362362
stage = [PBGitSVStageItem stageItem];
363363
[project addChild:stage];
364364

@@ -369,18 +369,18 @@ - (void)populateList
369369
others = [PBSourceViewItem groupItemWithTitle:@"Other"];
370370
stashes = [PBSourceViewItem groupItemWithTitle:@"Stashes"];
371371
submodules = [PBSourceViewItem groupItemWithTitle:@"Submodules"];
372-
372+
373373
for (PBGitRevSpecifier *rev in repository.branches)
374374
[self addRevSpec:rev];
375-
375+
376376
[items addObject:project];
377377
[items addObject:branches];
378378
[items addObject:remotes];
379379
[items addObject:tags];
380380
[items addObject:others];
381381
[items addObject:stashes];
382382
[items addObject:submodules];
383-
383+
384384
[sourceView reloadData];
385385
[sourceView expandItem:project];
386386
[sourceView expandItem:branches expandChildren:YES];
@@ -396,7 +396,7 @@ - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id
396396
{
397397
if (!item)
398398
return [items objectAtIndex:index];
399-
399+
400400
return [[(PBSourceViewItem *)item children] objectAtIndex:index];
401401
}
402402

@@ -409,7 +409,7 @@ - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id
409409
{
410410
if (!item)
411411
return [items count];
412-
412+
413413
return [[(PBSourceViewItem *)item children] count];
414414
}
415415

@@ -430,7 +430,7 @@ - (void) addMenuItemsForRef:(PBGitRef *)ref toMenu:(NSMenu *)menu
430430
{
431431
if (!ref)
432432
return;
433-
433+
434434
for (NSMenuItem *menuItem in [historyViewController.refController menuItemsForRef:ref])
435435
[menu addItem:menuItem];
436436
}
@@ -441,7 +441,7 @@ - (NSMenuItem *) actionIconItem
441441
NSImage *actionIcon = [NSImage imageNamed:@"NSActionTemplate"];
442442
[actionIcon setSize:NSMakeSize(12, 12)];
443443
[actionIconItem setImage:actionIcon];
444-
444+
445445
return actionIconItem;
446446
}
447447

@@ -472,11 +472,11 @@ - (NSMenu *) menuForRow:(NSInteger)row
472472
PBGitRef *ref = [viewItem ref];
473473
if (!ref)
474474
return nil;
475-
475+
476476
NSMenu *menu = [[NSMenu alloc] init];
477477
[menu setAutoenablesItems:NO];
478478
[self addMenuItemsForRef:ref toMenu:menu];
479-
479+
480480
return menu;
481481
}
482482

@@ -485,7 +485,7 @@ - (void) menuNeedsUpdate:(NSMenu *)menu
485485
{
486486
[actionButton removeAllItems];
487487
[menu addItem:[self actionIconItem]];
488-
488+
489489
PBGitRef *ref = [[self selectedItem] ref];
490490
[self addMenuItemsForRef:ref toMenu:menu];
491491
}
@@ -503,11 +503,11 @@ - (void) menuNeedsUpdate:(NSMenu *)menu
503503
- (void) updateRemoteControls
504504
{
505505
BOOL hasRemote = NO;
506-
506+
507507
PBGitRef *ref = [[self selectedItem] ref];
508508
if ([ref isRemote] || ([ref isBranch] && [[repository remoteRefForBranch:ref error:NULL] remoteName]))
509509
hasRemote = YES;
510-
510+
511511
[remoteControls setEnabled:hasRemote forSegment:kFetchSegment];
512512
[remoteControls setEnabled:hasRemote forSegment:kPullSegment];
513513
[remoteControls setEnabled:hasRemote forSegment:kPushSegment];
@@ -522,26 +522,26 @@ - (void) updateRemoteControls
522522
- (IBAction) fetchPullPushAction:(id)sender
523523
{
524524
NSInteger selectedSegment = [sender selectedSegment];
525-
525+
526526
if (selectedSegment == kAddRemoteSegment) {
527527
[PBAddRemoteSheet beginAddRemoteSheetForRepository:repository];
528528
return;
529529
}
530-
530+
531531
NSInteger index = [sourceView selectedRow];
532532
PBSourceViewItem *item = [sourceView itemAtRow:index];
533533
PBGitRef *ref = [[item revSpecifier] ref];
534-
534+
535535
if (!ref && (item.parent == remotes))
536536
ref = [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:[item title]]];
537-
537+
538538
if (![ref isRemote] && ![ref isBranch])
539539
return;
540-
540+
541541
PBGitRef *remoteRef = [repository remoteRefForBranch:ref error:NULL];
542542
if (!remoteRef)
543543
return;
544-
544+
545545
if (selectedSegment == kFetchSegment)
546546
[repository beginFetchFromRemoteForRef:ref];
547547
else if (selectedSegment == kPullSegment)

PBSourceViewCell.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
#import "PBIconAndTextCell.h"
1111

1212
@interface PBSourceViewCell : PBIconAndTextCell {
13+
NSString *badge;
1314
BOOL showsActionButton;
1415

1516
BOOL iMouseDownInInfoButton;
1617
BOOL iMouseHoveredInInfoButton;
1718
SEL iInfoButtonAction;
18-
NSString *badge;
1919
}
20-
2120
@property (nonatomic) BOOL showsActionButton;
2221
@property (nonatomic) SEL iInfoButtonAction;
2322
@property (assign) NSString *badge;

PBSourceViewCell.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ @interface PBSourceViewCell()
1414
- (NSRect)infoButtonRectForBounds:(NSRect)bounds;
1515
@end
1616

17-
1817
@implementation PBSourceViewCell
1918
@synthesize iInfoButtonAction;
2019
@synthesize showsActionButton;
21-
2220
@synthesize badge;
2321

2422
# pragma mark context menu delegate methods

0 commit comments

Comments
 (0)