[bug] Repository.copy() copies inventory first
John A Meinel
john at arbash-meinel.com
Thu Feb 16 14:29:37 GMT 2006
Robert Collins wrote:
> On Thu, 2006-02-16 at 01:09 -0600, John A Meinel wrote:
>> Robert Collins wrote:
>
...
> its used by clone and sprout. I'm not sure whether to move that out of
> copy_content_into to clone, as its useful for copying the content of a
> branch into another, and I expect that the generic 'updater' logic will
> want to do that. But we can move it and later put it back.
If there is a specific contract of what 'copy_content_into' is supposed
to mean, I don't mind. It seemed more like a helper function for both
clone and sprout, but they need different assistance.
>
>> === modified file 'bzrlib/repository.py'
>
> fine
Thanks.
>
>> === modified file 'bzrlib/store/__init__.py'
>> --- bzrlib/store/__init__.py
>> +++ bzrlib/store/__init__.py
>> @@ -316,7 +316,11 @@
>> # TODO: Optional progress indicator
>> if not store_from.listable():
>> raise UnlistableStore(store_from)
>> - ids = [f for f in store_from]
>> + pb = bzrlib.ui.ui_factory.progress_bar()
>> + ids = []
>> + for count, file_id in enumerate(store_from):
>> + pb.update('listing files', count, count)
>> + ids.append(file_id)
>> mutter('copy_all ids: %r', ids)
>> store_to.copy_multi(store_from, ids)
>
> I missed this before : This should accept a passed in pb and either do
> 'if pb is not None:
> pb.update...'
>
> or
> 'if pb is None:
> pb = bzrlib.ui.ui_factory.progress_bar()'
>
>
I would probably go for the first one (optional progress from the
caller). When I was writing the patch, I didn't want to change the
copy_multi() api. Though I guess the WeaveStore.copy_multi is different
than Store.copy_multi.
(Actually, I have some doubts that WeaveStore should inherit from Store,
considering its api is completely different).
Do I get a +1 if I make both of these changes?
>
> Rob
>
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060216/5040b3c1/attachment.pgp
More information about the bazaar
mailing list