diff --git a/PBGitCommit.h b/PBGitCommit.h index 5d7c2f2..70a6001 100644 --- a/PBGitCommit.h +++ b/PBGitCommit.h @@ -21,7 +21,7 @@ NSString* details; NSString *_patch; NSArray* parents; - NSMutableArray* refs; + int timestamp; char sign; id lineInfo; diff --git a/PBGitCommit.m b/PBGitCommit.m index be705b0..9f9de44 100644 --- a/PBGitCommit.m +++ b/PBGitCommit.m @@ -11,7 +11,7 @@ @implementation PBGitCommit -@synthesize repository, subject, timestamp, author, parentShas, nParents, sign, lineInfo, refs; +@synthesize repository, subject, timestamp, author, parentShas, nParents, sign, lineInfo; - (NSArray *) parents { @@ -107,9 +107,19 @@ if (!self.refs) return; - [refs removeObject:ref]; - if ([refs count] == 0) - refs = NULL; + [self.refs removeObject:ref]; + if ([self.refs count] == 0) + self.refs = NULL; +} + +- (NSMutableArray *)refs +{ + return [[repository refs] objectForKey:[self realSha]]; +} + +- (void) setRefs:(NSMutableArray *)refs +{ + [[repository refs] setObject:[self realSha] forKey:[self realSha]]; } - (void)finalize diff --git a/PBGitGrapher.h b/PBGitGrapher.h index ccc65c3..d17f3bd 100644 --- a/PBGitGrapher.h +++ b/PBGitGrapher.h @@ -15,8 +15,6 @@ PBGraphCellInfo *previous; void *pl; int curLane; - - NSDictionary *refs; } - (id) initWithRepository:(PBGitRepository *)repo; diff --git a/PBGitGrapher.mm b/PBGitGrapher.mm index 833ef7f..f9daf84 100644 --- a/PBGitGrapher.mm +++ b/PBGitGrapher.mm @@ -21,7 +21,6 @@ using namespace std; - (id) initWithRepository: (PBGitRepository*) repo { - refs = repo.refs; pl = new std::list; PBGitLane::resetColors(); diff --git a/PBGitRepository.h b/PBGitRepository.h index da87e86..d3be759 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -62,5 +62,5 @@ extern NSString* PBGitRepositoryErrorDomain; @property (retain) PBGitRevList* revisionList; @property (assign) NSMutableArray* branches; @property (assign) PBGitRevSpecifier *currentBranch; -@property (assign) NSMutableDictionary* refs; +@property (retain) NSMutableDictionary* refs; @end diff --git a/PBGitRepository.m b/PBGitRepository.m index a4a5880..72326ca 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -228,8 +228,6 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; [self addRef:newRef fromParameters:components]; } - self.refs = refs; - // Add an "All branches" option in the branches list [self addBranch:[PBGitRevSpecifier allBranchesRevSpec]]; [self addBranch:[PBGitRevSpecifier localBranchesRevSpec]]; diff --git a/PBGitRevList.mm b/PBGitRevList.mm index f2d4ccd..cc6eb84 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -71,7 +71,6 @@ using namespace std; NSDate *start = [NSDate date]; NSMutableArray* revisions = [NSMutableArray array]; PBGitGrapher* g = [[PBGitGrapher alloc] initWithRepository: repository]; - NSDictionary* refs = [repository refs]; NSMutableArray* arguments; BOOL showSign = [rev hasLeftRight]; @@ -170,11 +169,7 @@ using namespace std; [revisions addObject: newCommit]; [g decorateCommit: newCommit]; - - // 0.1 second on linux-2.6 - if (refs && [refs objectForKey:[newCommit realSha]]) - newCommit.refs = [refs objectForKey:[newCommit realSha]]; - + if (++num % 1000 == 0) [self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:NO]; } diff --git a/html/views/history/history.js b/html/views/history/history.js index ee3e98c..eb99615 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -2,7 +2,7 @@ var commit; var Commit = function(obj) { this.object = obj; - this.refs = obj.refs; + this.refs = obj.refs(); this.author_name = obj.author; this.sha = obj.realSha(); this.parents = obj.parents;