Rev 2320: Change Branch5._gen_revision_history() to be a bit faster about reading all revisions. in http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/unicode_id_warnings
John Arbash Meinel
john at arbash-meinel.com
Fri Mar 2 19:27:14 GMT 2007
At http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/unicode_id_warnings
------------------------------------------------------------
revno: 2320
revision-id: john at arbash-meinel.com-20070302192706-7npsqodk033g21al
parent: john at arbash-meinel.com-20070302185900-8wyh1uzo0tlbupx7
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: unicode_id_warnings
timestamp: Fri 2007-03-02 13:27:06 -0600
message:
Change Branch5._gen_revision_history() to be a bit faster about reading all revisions.
modified:
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2007-03-01 07:15:55 +0000
+++ b/bzrlib/branch.py 2007-03-02 19:27:06 +0000
@@ -1333,9 +1333,10 @@
self.set_revision_history(history)
def _gen_revision_history(self):
- get_cached_utf8 = cache_utf8.get_cached_utf8
- history = [get_cached_utf8(l.rstrip('\r\n')) for l in
- self.control_files.get('revision-history').readlines()]
+ history = self.control_files.get('revision-history').read().split('\n')
+ if history[-1:] == ['']:
+ # There shouldn't be a trailing newline, but just in case.
+ history.pop()
return history
@needs_read_lock
More information about the bazaar-commits
mailing list