Remove debugging NSLog clutter and other left-over code.

This commit is contained in:
André Berg
2010-04-06 00:03:07 +02:00
parent d1474bd22a
commit d54dca4f42
5 changed files with 22 additions and 79 deletions
+3 -3
View File
@@ -121,8 +121,8 @@ static ApplicationController * sharedApplicationControllerInstance = nil;
self.cliArgs = [NSString stringWithUTF8String:(cliargs)];
}
NSLog(@"[%@ %s] launchedFromGitx = %@", [self class], _cmd, (launchedFromGitx ? @"YES" : @"NO"));
NSLog(@"[%@ %s] cliArgs = %@", [self class], _cmd, cliArgs);
// NSLog(@"[%@ %s] launchedFromGitx = %@", [self class], _cmd, (launchedFromGitx ? @"YES" : @"NO"));
// NSLog(@"[%@ %s] cliArgs = %@", [self class], _cmd, cliArgs);
[self registerServices];
@@ -219,7 +219,7 @@ static ApplicationController * sharedApplicationControllerInstance = nil;
- (void) finalizeCLILaunch:(id)object {
for (PBGitRepository * document in launchedDocuments) {
BOOL success = [[[(PBGitRepository *)document windowController] historyController] selectCommit:self.deferredSelectSha];
NSLog(@"[%@ %s] trying to select commit with sha %@ (success = %@)", [self class], _cmd, self.deferredSelectSha, BMStringFromBOOL(success));
// NSLog(@"[%@ %s] trying to select commit with sha %@ (success = %@)", [self class], _cmd, self.deferredSelectSha, BMStringFromBOOL(success));
if (success) {
PBGitWindowController * wc = [(PBGitRepository *)document windowController];
PBGitHistoryController * histController = wc.historyController;
+4 -45
View File
@@ -31,7 +31,7 @@
- (BOOL) openRepository:(in bycopy NSString *)repositoryPath arguments:(in bycopy NSArray *)args error:(byref NSError **)error
{
NSLog(@"============================== PBCLIProxy START ==============================");
// NSLog(@"============================== PBCLIProxy START ==============================");
if (!repositoryPath || !args) {
return NO;
@@ -66,7 +66,7 @@
*error = [NSError errorWithDomain:PBCLIProxyErrorDomain code:errCode userInfo:userInfo];
}
NSLog(@"============================== PBCLIProxy Abort ==============================");
// NSLog(@"============================== PBCLIProxy Abort ==============================");
return NO;
} else if (![document checkRefFormat:fullargs] &&
![document checkRefFormatForBranch:fullargs]) {
@@ -85,52 +85,11 @@
fprintf(stderr, "\t%s\n", [[*error localizedFailureReason] UTF8String]);
}
NSLog(@"document = %@ at path = %@", document, repositoryPath);
// if ([args count] > 0 && ([[args objectAtIndex:0] isEqualToString:@"--commit"] ||
// [[args objectAtIndex:0] isEqualToString:@"-c"])) {
// [document.windowController showCommitView:self];
// }
// else if ([args count] > 0 && ([[args objectAtIndex:0] hasPrefix:@"--author"])) {
// NSArray * components = [[args objectAtIndex:0] componentsSeparatedByString:@"="];
// NSString * author = [components objectAtIndex:1];
// NSArrayController * ccontroller = document.windowController.historyController.commitController;
// [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"author contains[c] %@", author]];
// [document.windowController.historyController.commitList selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
// } else if ([args count] > 0 && ([[args objectAtIndex:0] hasPrefix:@"--subject"])) {
// NSArray * components = [[args objectAtIndex:0] componentsSeparatedByString:@"="];
// NSString * subject = [components objectAtIndex:1];
// NSArrayController * ccontroller = document.windowController.historyController.commitController;
// [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"subject contains[c] %@", subject]];
// } else if ([args count] > 0 && ([[args objectAtIndex:0] hasPrefix:@"--sha"])) {
// NSArray * components = [[args objectAtIndex:0] componentsSeparatedByString:@"="];
// NSString * sha = [components objectAtIndex:1];
// NSArrayController * ccontroller = document.windowController.historyController.commitController;
// [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"realSha contains[c] %@", sha]];
// } else if ([args count] > 0 && ([[args objectAtIndex:0] hasPrefix:@"-S"])) {
// NSString * subject = [[args objectAtIndex:0] substringFromIndex:2];
// NSArrayController * ccontroller = document.windowController.historyController.commitController;
// [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"subject contains[c] %@", subject]];
// }
// if ([args count] > 0 && [[args objectAtIndex:0] isEqualToString:@"--all"]) {
// document.currentBranchFilter = kGitXAllBranchesFilter;
// } else if ([args count] > 0 && [[args objectAtIndex:0] isEqualToString:@"--local"]) {
// document.currentBranchFilter = kGitXLocalRemoteBranchesFilter;
// }
// [document readCurrentBranch];
// rev = document.currentBranch;
//
// if (!rev && [args count] > 0) {
// rev = [[PBGitRevSpecifier alloc] initWithParameters:args];
// document.currentBranch = rev;
// document.currentBranchFilter = kGitXSelectedBranchFilter;
// }
// NSLog(@"document = %@ at path = %@", document, repositoryPath);
[NSApp activateIgnoringOtherApps:YES];
NSLog(@"============================== PBCLIProxy END ==============================");
// NSLog(@"============================== PBCLIProxy END ==============================");
return YES;
}
+3 -3
View File
@@ -424,7 +424,7 @@
commitList.useAdjustScroll = YES;
}
NSLog(@"[%@ %s] newIndex = %d, oldIndex = %d", [self class], _cmd, newIndex, oldIndex);
// NSLog(@"[%@ %s] newIndex = %d, oldIndex = %d", [self class], _cmd, newIndex, oldIndex);
[commitList scrollRowToVisible:newIndex];
commitList.useAdjustScroll = NO;
@@ -447,7 +447,7 @@
if (appController.launchedFromGitx && [appController.cliArgs isEqualToString:@"--commit"]) {
return NO;
}
NSLog(@"[%@ %s]: SHA = %@", [self class], _cmd, commitSHA);
// NSLog(@"[%@ %s]: SHA = %@", [self class], _cmd, commitSHA);
if (!forceSelectionUpdate && [[selectedCommit realSha] isEqualToString:commitSHA])
return NO;
@@ -462,7 +462,7 @@
[commitController setSelectedObjects:selectedCommits];
if (repository.currentBranchFilter != kGitXSelectedBranchFilter) {
NSLog(@"[%@ %s] currentBranchFilter = %@", [self class], _cmd, PBStringFromBranchFilterType(repository.currentBranchFilter));
// NSLog(@"[%@ %s] currentBranchFilter = %@", [self class], _cmd, PBStringFromBranchFilterType(repository.currentBranchFilter));
[self scrollSelectionToTopOfViewFrom:oldIndex];
}
+11 -27
View File
@@ -69,7 +69,7 @@
- (void)populateList
{
NSLog(@"[%@ %s]", [self class], _cmd);
// NSLog(@"[%@ %s]", [self class], _cmd);
PBSourceViewItem *project = [PBSourceViewItem groupItemWithTitle:[repository projectName]];
project.isUncollapsible = YES;
@@ -166,20 +166,20 @@
if (resolvedRev) {
repository.currentBranch = resolvedRev;
//repository.currentBranch.isSimpleRef = YES;
NSLog(@"[%@ %s] currentBranch = %@", [self class], _cmd, repository.currentBranch);
NSLog(@"[%@ %s] items = %@", [self class], _cmd, [items description]);
// NSLog(@"[%@ %s] currentBranch = %@", [self class], _cmd, repository.currentBranch);
// NSLog(@"[%@ %s] items = %@", [self class], _cmd, [items description]);
for (PBSourceViewItem * item in items) {
if (deferredSelectObject = [item findRev:resolvedRev])
break;
}
NSLog(@"[%@ %s] deferredSelectObject = %@", [self class], _cmd, deferredSelectObject);
// NSLog(@"[%@ %s] deferredSelectObject = %@", [self class], _cmd, deferredSelectObject);
}
}
}
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
NSLog(@"[%@ %s]", [self class], _cmd);
// NSLog(@"[%@ %s]", [self class], _cmd);
if ([@"currentBranchChange" isEqualToString:context]) {
[sourceView reloadData];
@@ -227,7 +227,7 @@
{
[sourceView PBExpandItem:branchItem expandParents:YES];
NSInteger row = [sourceView rowForItem:branchItem];
NSLog(@"[%@ %s] rowForItem (%@) = %d", [self class], _cmd, branchItem, row);
// NSLog(@"[%@ %s] rowForItem (%@) = %d", [self class], _cmd, branchItem, row);
NSIndexSet *index = [NSIndexSet indexSetWithIndex:row];
[sourceView selectRowIndexes:index byExtendingSelection:NO];
}
@@ -236,7 +236,7 @@
PBSourceViewItem *foundItem = nil;
for (PBSourceViewItem *item in items) {
if (foundItem = [item findRev:rev]) {
NSLog(@"[%@ %s]: found item! Item = %@ for rev = %@", [self class], _cmd, item, rev);
//NSLog(@"[%@ %s]: found item! Item = %@ for rev = %@", [self class], _cmd, item, rev);
return foundItem;
}
}
@@ -245,9 +245,9 @@
- (BOOL) selectCommitWithSha:(NSString *)refSHA {
NSArray *revList = repository.revisionList.commits;
NSLog(@"[%@ %s] revList = %@", [self class], _cmd, revList);
// NSLog(@"[%@ %s] revList = %@", [self class], _cmd, revList);
for (PBGitCommit *commit in revList) {
NSLog(@"[%@ %s] commit = %@", [self class], _cmd, commit);
// NSLog(@"[%@ %s] commit = %@", [self class], _cmd, commit);
if ([[commit realSha] isEqualToString:refSHA]) {
[historyViewController selectCommit:refSHA];
return YES;
@@ -260,7 +260,7 @@
{
PBGitRevSpecifier *rev = repository.currentBranch;
NSLog(@"[%@ %s] rev = %@", [self class], _cmd, rev);
// NSLog(@"[%@ %s] rev = %@", [self class], _cmd, rev);
if (deferredSelectObject) {
NSString * sha = [ApplicationController sharedApplicationController].deferredSelectSha;
@@ -270,7 +270,7 @@
}
[self selectBranch:deferredSelectObject];
//[historyViewController selectCommit:sha];
deferredSelectObject = nil;
return;
}
@@ -280,24 +280,8 @@
[repository readCurrentBranch];
return;
}
// else {
// NSString * refSHA = [repository shaForRef:[rev ref]];
// if (![self selectCommitWithSha:refSHA]) {
// [repository reloadRefs];
// [self selectCommitWithSha:refSHA];
// }
// }
PBSourceViewItem *item = [self itemForRev:rev];
// if (!item) {
// // Obviously we havn't found the item so we reset it's isSimpleRef status back to NO
// // so it will get added to the OTHER group.
// //[rev setIsSimpleRef:NO];
// [self addRevSpec:rev];
// // Try to find the just added item again.
// item = [self itemForRev:rev];
// }
[self selectBranch:item];
}
+1 -1
View File
@@ -111,7 +111,7 @@
- (PBSourceViewItem *) findRev:(PBGitRevSpecifier *)rev
{
NSLog(@"[%@ %s] rev = %@, revSpecifier = %@", [self class], _cmd, rev, revSpecifier);
// NSLog(@"[%@ %s] rev = %@, revSpecifier = %@", [self class], _cmd, rev, revSpecifier);
if (rev == revSpecifier || [rev isEqual:revSpecifier])
return self;