[BUG] progress bar with bzr pull/copy/copy_to
John Arbash Meinel
john at arbash-meinel.com
Tue Jan 24 01:28:35 GMT 2006
Brian M. Carlson wrote:
> Sorry for all the mails, but Debian has ingrained in me the importance
> of "one bug, one report".
>
> When doing a bzr pull, the progress bar is updated. When doing the copy
> step, it shows total number of items copied, then, it flickers to
> copy_to, which shows 0/1 items copied. Then it goes back, lather, rinse,
> repeat.
>
> My question is, wouldn't it make more sense to buffer some small amount
> of items and then copy them? I know it is probably more efficient
> writing to disk (and will most likely get them less fragmented, and
> therefore more efficient future access). If we allow copying from one
> remote repository to another, then it makes even more sense, because
> there is less overhead.
>
> If for some reason this is not possible or not desirable, could the
> progress bar not flicker back and forth, as this is somewhat
> disconcerting?
I'm not really worried about writing more than one at a time. We
generally read the whole file into memory (possibly merging it with
another file), and then write it out all at once.
There is definitely an issue with the progress bar. The code involved
seems to be:
bzrlib/store/text.py => _copy_one
The problem is that _copy_one seems to be designed to only copy a single
entry. And then it calls 'copy_to' which is designed to copy multiple
entries. But it passes in a progress bar which is effectively saying
"report the progress of copying this single revision."
I'm also seeing this:
copy_to: .
copy: .
copy_to: .
copy: .
copy_to: .
copy: .
copy_to: .
copy: .
Which looks like we are also getting something updating 'copy' multiple
times. The two places which do this are
bzrlib/store/__init__.py 'copy_multi', and Transport.copy_multi
I haven't been able to track down what code path is calling both
copy_multi and copy_to. But the following at least prevents us from
flickering quite as bad.
John
=:->
=== modified file 'bzrlib/store/text.py'
--- bzrlib/store/text.py
+++ bzrlib/store/text.py
@@ -95,7 +95,7 @@
raise KeyError(fileid + '-' + str(suffix))
try:
- result = other._transport.copy_to([path], self._transport,
pb=pb,
+ result = other._transport.copy_to([path], self._transport,
mode=self._file_mode)
except NoSuchFile:
if not self._prefixed:
@@ -104,7 +104,7 @@
self._transport.mkdir(hash_prefix(fileid)[:-1],
mode=self._dir_mode)
except FileExists:
pass
- result = other._transport.copy_to([path], self._transport,
pb=pb,
+ result = other._transport.copy_to([path], self._transport,
mode=self._file_mode)
if result != 1:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060123/16413ba9/attachment.pgp
More information about the bazaar
mailing list