Rev 2248: Don't create pb for simple knit reading. in http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/knit_no_pb
John Arbash Meinel
john at arbash-meinel.com
Wed Jan 31 18:58:15 GMT 2007
At http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/knit_no_pb
------------------------------------------------------------
revno: 2248
revision-id: john at arbash-meinel.com-20070131185810-dh3c6xgjgo684hw8
parent: pqm at pqm.ubuntu.com-20070131140456-56881c31a01089a3
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: knit_no_pb
timestamp: Wed 2007-01-31 12:58:10 -0600
message:
Don't create pb for simple knit reading.
modified:
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
-------------- next part --------------
=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py 2007-01-17 15:37:08 +0000
+++ b/bzrlib/knit.py 2007-01-31 18:58:10 +0000
@@ -1130,29 +1130,22 @@
# so - wc -l of a knit index is != the number of unique names
# in the knit.
self._history = []
- decode_utf8 = cache_utf8.decode
- pb = ui.ui_factory.nested_progress_bar()
try:
- pb.update('read knit index', 0, 1)
+ fp = self._transport.get(self._filename)
try:
- fp = self._transport.get(self._filename)
- try:
- # _load_data may raise NoSuchFile if the target knit is
- # completely empty.
- self._load_data(fp)
- finally:
- fp.close()
- except NoSuchFile:
- if mode != 'w' or not create:
- raise
- elif delay_create:
- self._need_to_create = True
- else:
- self._transport.put_bytes_non_atomic(
- self._filename, self.HEADER, mode=self._file_mode)
- finally:
- pb.update('read knit index', 1, 1)
- pb.finished()
+ # _load_data may raise NoSuchFile if the target knit is
+ # completely empty.
+ self._load_data(fp)
+ finally:
+ fp.close()
+ except NoSuchFile:
+ if mode != 'w' or not create:
+ raise
+ elif delay_create:
+ self._need_to_create = True
+ else:
+ self._transport.put_bytes_non_atomic(
+ self._filename, self.HEADER, mode=self._file_mode)
def _load_data(self, fp):
cache = self._cache
More information about the bazaar-commits
mailing list