[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Beginnings of python script for annotate

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2002-08-13 19:33:10 CEST

Does all that one needs, except that it's slow.
The reason it's slow is because it uses python's difflib to do the diffs
(I verified this is the large part of the current slowness.
On gdb's dwarf2read.c, where we have a few revisions (8, i think) of the
actual file, and 700 revisions of the repository (that's all i felt like
importing),not doing the diffs takes 3 seconds, doing them takes 20

I also couldn't remember how to get the oldest revision of a file.
It does two things that probably make up the majority of the 3 seconds:
1. It walks each revision from 1, checking when the path starts to exist,
to get the oldest revision.
2. It uses fs_file_contents_changed to determine if the contents changed
from one revision to another.
This is faster than using python diff to do it.

The code is the result of 30 minutes of hacking getfile.py , so it's ugly.

It's also not perfect, the line counting is off slightly somehow.

Since the diff results are a generator in 2.2.1, i can't get the length of
it unless i add another for loop.

But the method is there.

--Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Tue Aug 13 19:33:42 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.