Speeding up reannotate

John Arbash Meinel john at arbash-meinel.com
Mon Feb 11 23:01:56 GMT 2008


John Arbash Meinel wrote:

...

> Writing this down did bring up 1 possibility. After we've annotated with 
> the left-hand parent, what if we do the diff versus the annotated 
> right-hand parent.
> Then for blocks which match, we can just skip over them. For blocks that 
> *don't* match, then we do another diff on the unannotated lines for that 
> region. Matches and misses then get labeled according to the previous 
> resolution rules.
> 
> I'll give it a shot, but if someone has another idea, let me know.

I think I've implemented this, and it did indeed make it faster, but it seems to 
be generating different results.

I'm trying to figure out why, at the moment the best I can come up with is that 
lines which used to be considered "common" and thus would not be points to 
line-up, now have a chance to be considered unique, because their annotation 
information is different.

For example, the text might have been:

@needs_read_lock
def function(self, foo):
   return foo

@needs_read_lock
def function2(self, foo):
   return foo

Normally patience diff will ignore the @needs_read_lock and return foo lines. 
With annotations they might become:

rev1	@needs_read_lock
rev1	def function(self, foo):
rev1	  return foo
rev2
rev2	@needs_read_lock
rev2	def function2(self, foo):
rev2	  return foo

And now the lines are no longer in common since
(rev1, '@needs_read_lock\n') != (rev2, '@needs_read_lock\n')

This may not be the actual cause, but I think it could be something we need to 
think about.

Thoughts?

John
=:->



More information about the bazaar mailing list