Rev 4144: (mbp) fetch progress bars, code cleanups, and debug-flags topic in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Mar 13 06:21:47 GMT 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4144
revision-id: pqm at pqm.ubuntu.com-20090313062142-ndr3o27uwgysx9dv
parent: pqm at pqm.ubuntu.com-20090313044136-mvoy4mgr8az583ih
parent: mbp at sourcefrog.net-20090313054003-cfrlg0ybpmzqy29o
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2009-03-13 06:21:42 +0000
message:
(mbp) fetch progress bars, code cleanups, and debug-flags topic
added:
bzrlib/help_topics/en/debug-flags.txt debugflags.txt-20090312050229-rdspqbqq4fzbjtpe-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/debug.py debug.py-20061102062349-vdhrw9qdpck8cl35-1
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
bzrlib/progress.py progress.py-20050610070202-df9faaab791964c0
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/smart/medium.py medium.py-20061103051856-rgu2huy59fkz902q-1
bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
bzrlib/tests/per_repository/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
bzrlib/tests/test_ui.py test_ui.py-20051130162854-458e667a7414af09
bzrlib/ui/text.py text.py-20051130153916-2e438cffc8afc478
bzrlib/versionedfile.py versionedfile.py-20060222045106-5039c71ee3b65490
doc/developers/HACKING.txt HACKING-20050805200004-2a5dc975d870f78c
------------------------------------------------------------
revno: 4110.2.26
revision-id: mbp at sourcefrog.net-20090313054003-cfrlg0ybpmzqy29o
parent: mbp at sourcefrog.net-20090313050550-p1va8dzl8z0y7q9e
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress
timestamp: Fri 2009-03-13 15:40:03 +1000
message:
Remove outdated progress bar test
modified:
bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
------------------------------------------------------------
revno: 4110.2.25
revision-id: mbp at sourcefrog.net-20090313050550-p1va8dzl8z0y7q9e
parent: mbp at sourcefrog.net-20090313030114-y723gefxl8tfynsd
parent: pqm at pqm.ubuntu.com-20090313044136-mvoy4mgr8az583ih
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress
timestamp: Fri 2009-03-13 15:05:50 +1000
message:
merge trunk
added:
doc/en/user-guide/shelving_changes.txt shelving_changes.txt-20090312060214-kfn9smg37syy9kcl-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzr bzr.py-20050313053754-5485f144c7006fa6
bzrlib/__init__.py __init__.py-20050309040759-33e65acf91bbcd5d
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/shelf.py prepare_shelf.py-20081005181341-n74qe6gu1e65ad4v-1
bzrlib/shelf_ui.py shelver.py-20081005210102-33worgzwrtdw0yrm-1
bzrlib/tests/blackbox/test_ignore.py test_ignore.py-20060703063225-4tm8dc2pa7wwg2t3-1
bzrlib/tests/bzrdir_implementations/test_bzrdir.py test_bzrdir.py-20060131065642-0ebeca5e30e30866
bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/per_repository_reference/__init__.py __init__.py-20080220025549-nnm2s80it1lvcwnc-2
bzrlib/tests/test_osutils.py test_osutils.py-20051201224856-e48ee24c12182989
bzrlib/tests/test_remote.py test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
bzrlib/tests/test_shelf.py test_prepare_shelf.p-20081005181341-n74qe6gu1e65ad4v-2
bzrlib/tests/test_shelf_ui.py test_shelf_ui.py-20081027155203-wtcuazg85wp9u4fv-1
doc/en/user-guide/bzrtools_plugin.txt bzrtools_plugin.txt-20080509065016-cjc90f46407vi9a0-1
doc/en/user-guide/index.txt index.txt-20060622101119-tgwtdci8z769bjb9-2
------------------------------------------------------------
revno: 4110.2.24
revision-id: mbp at sourcefrog.net-20090313030114-y723gefxl8tfynsd
parent: mbp at sourcefrog.net-20090313025552-x3i9oc0z3r7q1oco
parent: pqm at pqm.ubuntu.com-20090313010135-3huetgz68wxrhsb3
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress
timestamp: Fri 2009-03-13 13:01:14 +1000
message:
merge trunk
removed:
bzrlib/help_topics/en/hooks.txt hooks.txt-20070830033044-xxu2rced13f72dka-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/bugtracker.py bugtracker.py-20070410073305-vu1vu1qosjurg8kb-1
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/commands.py bzr.py-20050309040720-d10f4714595cf8c3
bzrlib/errors.py errors.py-20050309040759-20512168c4e14fbd
bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
bzrlib/hooks.py hooks.py-20070325015548-ix4np2q0kd8452au-1
bzrlib/inventory.py inventory.py-20050309040759-6648b84ca2005b37
bzrlib/lock.py lock.py-20050527050856-ec090bb51bc03349
bzrlib/lockdir.py lockdir.py-20060220222025-98258adf27fbdda3
bzrlib/log.py log.py-20050505065812-c40ce11702fe5fb1
bzrlib/mail_client.py mail_client.py-20070809192806-vuxt3t19srtpjpdn-1
bzrlib/msgeditor.py msgeditor.py-20050901111708-ef6d8de98f5d8f2f
bzrlib/mutabletree.py mutabletree.py-20060906023413-4wlkalbdpsxi2r4y-2
bzrlib/push.py push.py-20080606021927-5fe39050e8xne9un-1
bzrlib/registry.py lazy_factory.py-20060809213415-2gfvqadtvdn0phtg-1
bzrlib/revision.py revision.py-20050309040759-e77802c08f3999d5
bzrlib/shelf.py prepare_shelf.py-20081005181341-n74qe6gu1e65ad4v-1
bzrlib/shelf_ui.py shelver.py-20081005210102-33worgzwrtdw0yrm-1
bzrlib/smart/client.py client.py-20061116014825-2k6ada6xgulslami-1
bzrlib/smart/server.py server.py-20061110062051-chzu10y32vx8gvur-1
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/blackbox/test_cat.py test_cat.py-20051201162916-f0937e4e19ea24b3
bzrlib/tests/blackbox/test_hooks.py test_hooks.py-20080308163236-xljgf9j41hik1x21-1
bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
bzrlib/tests/blackbox/test_shelve.py test_ls_shelf.py-20081202053526-thlo8yt0pi1cgor1-1
bzrlib/tests/branch_implementations/test_revision_history.py test_revision_histor-20070326062311-v7co92liyuchb80w-1
bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
bzrlib/tests/inventory_implementations/basics.py basics.py-20070903044446-kdjwbiu1p1zi9phs-1
bzrlib/tests/test_branch.py test_branch.py-20060116013032-97819aa07b8ab3b5
bzrlib/tests/test_bugtracker.py test_bugtracker.py-20070410073305-vu1vu1qosjurg8kb-2
bzrlib/tests/test_bzrdir.py test_bzrdir.py-20060131065654-deba40eef51cf220
bzrlib/tests/test_help.py test_help.py-20070419045354-6q6rq15j9e2n5fna-1
bzrlib/tests/test_hooks.py test_hooks.py-20070628030849-89rtsbe5dmer5npz-1
bzrlib/tests/test_mail_client.py test_mail_client.py-20070809192806-vuxt3t19srtpjpdn-2
bzrlib/tests/test_mutabletree.py test_mutabletree.py-20080405014429-2v0cdi3re320p8db-1
bzrlib/tests/test_osutils.py test_osutils.py-20051201224856-e48ee24c12182989
bzrlib/tests/test_revision.py testrevision.py-20050804210559-46f5e1eb67b01289
bzrlib/tests/test_shelf.py test_prepare_shelf.p-20081005181341-n74qe6gu1e65ad4v-2
bzrlib/tests/test_shelf_ui.py test_shelf_ui.py-20081027155203-wtcuazg85wp9u4fv-1
bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
------------------------------------------------------------
revno: 4110.2.23
revision-id: mbp at sourcefrog.net-20090313025552-x3i9oc0z3r7q1oco
parent: mbp at sourcefrog.net-20090313023626-7xn5siauidkgm1jw
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress
timestamp: Fri 2009-03-13 12:55:52 +1000
message:
blackbox hpss test should check repository was remotely locked
modified:
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
------------------------------------------------------------
revno: 4110.2.22
revision-id: mbp at sourcefrog.net-20090313023626-7xn5siauidkgm1jw
parent: mbp at sourcefrog.net-20090313023616-l8brsh92kuzuoq7i
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress
timestamp: Fri 2009-03-13 12:36:26 +1000
message:
Re-add mutter calls during fetch
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
------------------------------------------------------------
revno: 4110.2.21
revision-id: mbp at sourcefrog.net-20090313023616-l8brsh92kuzuoq7i
parent: mbp at sourcefrog.net-20090312080742-j42k53e5vy8vhocs
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress
timestamp: Fri 2009-03-13 12:36:16 +1000
message:
Update NEWS
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
------------------------------------------------------------
revno: 4110.2.20
revision-id: mbp at sourcefrog.net-20090312080742-j42k53e5vy8vhocs
parent: mbp at sourcefrog.net-20090312072603-2encofaehyg1iplv
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 18:07:42 +1000
message:
Developer docs of progress bars
modified:
doc/developers/HACKING.txt HACKING-20050805200004-2a5dc975d870f78c
------------------------------------------------------------
revno: 4110.2.19
revision-id: mbp at sourcefrog.net-20090312072603-2encofaehyg1iplv
parent: mbp at sourcefrog.net-20090312071353-usd2dh37dsriuses
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 17:26:03 +1000
message:
Transport activity now shows scheme and direction
modified:
bzrlib/smart/medium.py medium.py-20061103051856-rgu2huy59fkz902q-1
bzrlib/ui/text.py text.py-20051130153916-2e438cffc8afc478
------------------------------------------------------------
revno: 4110.2.18
revision-id: mbp at sourcefrog.net-20090312071353-usd2dh37dsriuses
parent: mbp at sourcefrog.net-20090312070928-f110be8twil0w4ye
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 17:13:53 +1000
message:
Progress bars always repaint when task structure is changed
modified:
bzrlib/tests/test_ui.py test_ui.py-20051130162854-458e667a7414af09
bzrlib/ui/text.py text.py-20051130153916-2e438cffc8afc478
------------------------------------------------------------
revno: 4110.2.17
revision-id: mbp at sourcefrog.net-20090312070928-f110be8twil0w4ye
parent: mbp at sourcefrog.net-20090312065333-h0kotewsx4l52gqs
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 17:09:28 +1000
message:
If one ProgressTask has no count, it passes through that of its child
modified:
bzrlib/progress.py progress.py-20050610070202-df9faaab791964c0
bzrlib/tests/test_ui.py test_ui.py-20051130162854-458e667a7414af09
------------------------------------------------------------
revno: 4110.2.16
revision-id: mbp at sourcefrog.net-20090312065333-h0kotewsx4l52gqs
parent: mbp at sourcefrog.net-20090312064449-mrw7183pcdgospc2
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 16:53:33 +1000
message:
Refactor TextProgressView a bit and add another test
modified:
bzrlib/tests/test_ui.py test_ui.py-20051130162854-458e667a7414af09
bzrlib/ui/text.py text.py-20051130153916-2e438cffc8afc478
------------------------------------------------------------
revno: 4110.2.15
revision-id: mbp at sourcefrog.net-20090312064449-mrw7183pcdgospc2
parent: mbp at sourcefrog.net-20090312063647-06u94f77mk52dg7k
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 16:44:49 +1000
message:
Fix bug in showing task progress and add a test
modified:
bzrlib/tests/test_ui.py test_ui.py-20051130162854-458e667a7414af09
bzrlib/ui/text.py text.py-20051130153916-2e438cffc8afc478
------------------------------------------------------------
revno: 4110.2.14
revision-id: mbp at sourcefrog.net-20090312063647-06u94f77mk52dg7k
parent: mbp at sourcefrog.net-20090312063625-4lmum7kwqu4syole
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 16:36:47 +1000
message:
Small fetch progress tweaks
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
------------------------------------------------------------
revno: 4110.2.13
revision-id: mbp at sourcefrog.net-20090312063625-4lmum7kwqu4syole
parent: mbp at sourcefrog.net-20090312061200-xit38nboplch5b9b
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 16:36:25 +1000
message:
doc
modified:
bzrlib/progress.py progress.py-20050610070202-df9faaab791964c0
------------------------------------------------------------
revno: 4110.2.12
revision-id: mbp at sourcefrog.net-20090312061200-xit38nboplch5b9b
parent: mbp at sourcefrog.net-20090312054443-rz5kodxh1cjjx2id
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 16:12:00 +1000
message:
Add more fetch progress
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
------------------------------------------------------------
revno: 4110.2.11
revision-id: mbp at sourcefrog.net-20090312054443-rz5kodxh1cjjx2id
parent: mbp at sourcefrog.net-20090312054349-z5wkz6mskostowtg
parent: pqm at pqm.ubuntu.com-20090312052102-ksjfiyd5ctzibuo1
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 15:44:43 +1000
message:
merge trunk
added:
bzrlib/tests/per_repository_reference/test_default_stacking.py test_default_stackin-20090311055345-9ajahgm58oq3wh6h-1
tools/check-newsbugs.py checknewsbugs.py-20090128204947-lsdwd8nlswm1yrwv-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzr bzr.py-20050313053754-5485f144c7006fa6
bzrlib/__init__.py __init__.py-20050309040759-33e65acf91bbcd5d
bzrlib/_dirstate_helpers_c.pyx dirstate_helpers.pyx-20070503201057-u425eni465q4idwn-3
bzrlib/dirstate.py dirstate.py-20060728012006-d6mvoihjb3je9peu-1
bzrlib/errors.py errors.py-20050309040759-20512168c4e14fbd
bzrlib/hooks.py hooks.py-20070325015548-ix4np2q0kd8452au-1
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
bzrlib/lock.py lock.py-20050527050856-ec090bb51bc03349
bzrlib/lockable_files.py control_files.py-20051111201905-bb88546e799d669f
bzrlib/reconcile.py reweave_inventory.py-20051108164726-1e5e0934febac06e
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/smart/medium.py medium.py-20061103051856-rgu2huy59fkz902q-1
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
bzrlib/tests/per_repository/test_fileid_involved.py test_file_involved.py-20051215205901-728a172d1014daaa
bzrlib/tests/per_repository_reference/__init__.py __init__.py-20080220025549-nnm2s80it1lvcwnc-2
bzrlib/tests/test__dirstate_helpers.py test_dirstate_helper-20070504035751-jsbn00xodv0y1eve-2
bzrlib/tests/test_bzrdir.py test_bzrdir.py-20060131065654-deba40eef51cf220
bzrlib/tests/test_fetch.py testfetch.py-20050825090644-f73e07e7dfb1765a
bzrlib/tests/test_hooks.py test_hooks.py-20070628030849-89rtsbe5dmer5npz-1
bzrlib/tests/test_remote.py test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
bzrlib/tests/test_source.py test_source.py-20051207061333-a58dea6abecc030d
bzrlib/tests/test_urlutils.py test_urlutils.py-20060502192900-46b1f9579987cf9c
bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
bzrlib/tests/test_workingtree_4.py test_workingtree_4.p-20070223025758-531n3tznl3zacv2o-1
bzrlib/tests/tree_implementations/test_path_content_summary.py test_path_content_su-20070904100855-3vrwedz6akn34kl5-1
bzrlib/tests/workingtree_implementations/test_mkdir.py test_mkdir.py-20060907214856-4omn6hf1u7fvrart-3
bzrlib/tests/workingtree_implementations/test_nested_specifics.py test_nested_specific-20070306004443-qut978c488jr11sg-1
bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
bzrlib/tests/workingtree_implementations/test_workingtree.py test_workingtree.py-20060203003124-817757d3e31444fb
bzrlib/transform.py transform.py-20060105172343-dd99e54394d91687
bzrlib/transport/sftp.py sftp.py-20051019050329-ab48ce71b7e32dfe
bzrlib/ui/text.py text.py-20051130153916-2e438cffc8afc478
bzrlib/urlutils.py urlutils.py-20060502195429-e8a161ecf8fac004
bzrlib/versionedfile.py versionedfile.py-20060222045106-5039c71ee3b65490
bzrlib/weave.py knit.py-20050627021749-759c29984154256b
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
doc/developers/releasing.txt releasing.txt-20080502015919-fnrcav8fwy8ccibu-1
------------------------------------------------------------
revno: 4110.2.10
revision-id: mbp at sourcefrog.net-20090312054349-z5wkz6mskostowtg
parent: mbp at sourcefrog.net-20090312053653-7jx6tuj14xqpnje0
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 15:43:49 +1000
message:
Tweak iter_lines progress messages
modified:
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
bzrlib/versionedfile.py versionedfile.py-20060222045106-5039c71ee3b65490
------------------------------------------------------------
revno: 4110.2.9
revision-id: mbp at sourcefrog.net-20090312053653-7jx6tuj14xqpnje0
parent: mbp at sourcefrog.net-20090312051213-ix4cu4a315gmemyv
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 15:36:53 +1000
message:
Re-add very basic top-level pb for fetch
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
------------------------------------------------------------
revno: 4110.2.8
revision-id: mbp at sourcefrog.net-20090312051213-ix4cu4a315gmemyv
parent: mbp at sourcefrog.net-20090312051105-ee7vcl1ocgxntxmk
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 15:12:13 +1000
message:
Remove stray unguarded mutter call in fetch
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
------------------------------------------------------------
revno: 4110.2.7
revision-id: mbp at sourcefrog.net-20090312051105-ee7vcl1ocgxntxmk
parent: mbp at sourcefrog.net-20090312045527-7sxtcfa19z518m8h
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 15:11:05 +1000
message:
Split debug flags into their own help topic
added:
bzrlib/help_topics/en/debug-flags.txt debugflags.txt-20090312050229-rdspqbqq4fzbjtpe-1
modified:
bzrlib/debug.py debug.py-20061102062349-vdhrw9qdpck8cl35-1
bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
------------------------------------------------------------
revno: 4110.2.6
revision-id: mbp at sourcefrog.net-20090312045527-7sxtcfa19z518m8h
parent: mbp at sourcefrog.net-20090311075514-9vudl1frb30ng8sb
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Thu 2009-03-12 14:55:27 +1000
message:
Remove more progressbar cruft from fetch
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
------------------------------------------------------------
revno: 4110.2.5
revision-id: mbp at sourcefrog.net-20090311075514-9vudl1frb30ng8sb
parent: mbp at sourcefrog.net-20090311073528-8gyu3dkrkxz3lvj3
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Wed 2009-03-11 17:55:14 +1000
message:
Deprecate passing pbs in to fetch()
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
bzrlib/tests/per_repository/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
------------------------------------------------------------
revno: 4110.2.4
revision-id: mbp at sourcefrog.net-20090311073528-8gyu3dkrkxz3lvj3
parent: mbp at sourcefrog.net-20090311072102-bbh7i462c7knq2md
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Wed 2009-03-11 17:35:28 +1000
message:
Deprecate passing a pb in to RepoFetcher
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
------------------------------------------------------------
revno: 4110.2.3
revision-id: mbp at sourcefrog.net-20090311072102-bbh7i462c7knq2md
parent: mbp at sourcefrog.net-20090311070455-gay4qlayiamcq50k
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Wed 2009-03-11 17:21:02 +1000
message:
Remove redundant variable from fetch.
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
------------------------------------------------------------
revno: 4110.2.2
revision-id: mbp at sourcefrog.net-20090311070455-gay4qlayiamcq50k
parent: mbp at sourcefrog.net-20090311070122-r27fbj0crxx0xi2r
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Wed 2009-03-11 17:04:55 +1000
message:
Remove obsolete comments
modified:
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
------------------------------------------------------------
revno: 4110.2.1
revision-id: mbp at sourcefrog.net-20090311070122-r27fbj0crxx0xi2r
parent: pqm at pqm.ubuntu.com-20090311015637-v73ocbv9bcexe4dm
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: progress-fetch
timestamp: Wed 2009-03-11 17:01:22 +1000
message:
Remove duplicated code from InterRepository implementations.
modified:
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'NEWS'
--- a/NEWS 2009-03-13 03:16:26 +0000
+++ b/NEWS 2009-03-13 05:05:50 +0000
@@ -5,6 +5,7 @@
.. contents::
+
IN DEVELOPMENT
--------------
@@ -52,6 +53,8 @@
DOCUMENTATION:
+ * New topic `bzr help debug-flags`. (Martin Pool)
+
* The generated manpage now explicitly lists aliases as commands.
(James Westby, #336998)
@@ -61,6 +64,9 @@
sorts optimally for use with groupcompress compressors. (John Arbash
Meinel, Robert Collins)
+ * The ``pb`` argument to ``fetch()`` is deprecated.
+ (Martin Pool)
+
INTERNALS:
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2009-03-12 14:04:43 +0000
+++ b/bzrlib/branch.py 2009-03-13 03:01:14 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
+# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@
lockable_files,
repository,
revision as _mod_revision,
+ symbol_versioning,
transport,
tsort,
ui,
@@ -478,24 +479,19 @@
"""
if self.base == from_branch.base:
return (0, [])
- if pb is None:
- nested_pb = ui.ui_factory.nested_progress_bar()
- pb = nested_pb
- else:
- nested_pb = None
-
+ if pb is not None:
+ symbol_versioning.warn(
+ symbol_versioning.deprecated_in((1, 14, 0))
+ % "pb parameter to fetch()")
from_branch.lock_read()
try:
if last_revision is None:
- pb.update('get source history')
last_revision = from_branch.last_revision()
last_revision = _mod_revision.ensure_null(last_revision)
return self.repository.fetch(from_branch.repository,
revision_id=last_revision,
- pb=nested_pb)
+ pb=pb)
finally:
- if nested_pb is not None:
- nested_pb.finished()
from_branch.unlock()
def get_bound_location(self):
=== modified file 'bzrlib/debug.py'
--- a/bzrlib/debug.py 2009-03-06 04:59:54 +0000
+++ b/bzrlib/debug.py 2009-03-12 05:11:05 +0000
@@ -20,7 +20,7 @@
These are set with eg ``-Dlock`` on the bzr command line or in
~/.bazaar/bazaar.conf debug_flags.
-See "bzr help global-options" or bzrlib/help_topics/__init__.py
+See `bzr help debug-flags` or `bzrlib/help_topics/en/debug-flags.txt`
for a list of the available options.
"""
=== modified file 'bzrlib/fetch.py'
--- a/bzrlib/fetch.py 2009-03-04 07:10:07 +0000
+++ b/bzrlib/fetch.py 2009-03-13 02:36:26 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2008 Canonical Ltd
+# Copyright (C) 2005, 2006, 2008, 2009 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,19 +21,15 @@
that has merged into it. As the first step of a merge, pull, or
branch operation we copy history from the source into the destination
branch.
-
-The copying is done in a slightly complicated order. We don't want to
-add a revision to the store until everything it refers to is also
-stored, so that if a revision is present we can totally recreate it.
-However, we can't know what files are included in a revision until we
-read its inventory. So we query the inventory store of the source for
-the ids we need, and then pull those ids and then return to the inventories.
"""
import operator
import bzrlib
-import bzrlib.errors as errors
+from bzrlib import (
+ errors,
+ symbol_versioning,
+ )
from bzrlib.errors import InstallFailed
from bzrlib.progress import ProgressPhase
from bzrlib.revision import NULL_REVISION
@@ -42,30 +38,10 @@
import bzrlib.ui
from bzrlib.versionedfile import FulltextContentFactory
-# TODO: Avoid repeatedly opening weaves so many times.
-
-# XXX: This doesn't handle ghost (not present in branch) revisions at
-# all yet. I'm not sure they really should be supported.
-
-# NOTE: This doesn't copy revisions which may be present but not
-# merged into the last revision. I'm not sure we want to do that.
-
-# - get a list of revisions that need to be pulled in
-# - for each one, pull in that revision file
-# and get the inventory, and store the inventory with right
-# parents.
-# - and get the ancestry, and store that with right parents too
-# - and keep a note of all file ids and version seen
-# - then go through all files; for each one get the weave,
-# and add in all file versions
-
class RepoFetcher(object):
"""Pull revisions and texts from one repository to another.
- last_revision
- if set, try to limit to the data this revision references.
-
This should not be used directly, it's essential a object to encapsulate
the logic in InterRepository.fetch().
"""
@@ -74,11 +50,20 @@
pb=None, find_ghosts=True, fetch_spec=None):
"""Create a repo fetcher.
+ :param last_revision: If set, try to limit to the data this revision
+ references.
:param find_ghosts: If True search the entire history for ghosts.
:param _write_group_acquired_callable: Don't use; this parameter only
exists to facilitate a hack done in InterPackRepo.fetch. We would
like to remove this parameter.
+ :param pb: ProgressBar object to use; deprecated and ignored.
+ This method will just create one on top of the stack.
"""
+ if pb is not None:
+ symbol_versioning.warn(
+ symbol_versioning.deprecated_in((1, 14, 0))
+ % "pb parameter to RepoFetcher.__init__")
+ # and for simplicity it is in fact ignored
if to_repository.has_same_location(from_repository):
# repository.fetch should be taking care of this case.
raise errors.BzrError('RepoFetcher run '
@@ -91,19 +76,12 @@
self._last_revision = last_revision
self._fetch_spec = fetch_spec
self.find_ghosts = find_ghosts
- if pb is None:
- self.pb = bzrlib.ui.ui_factory.nested_progress_bar()
- self.nested_pb = self.pb
- else:
- self.pb = pb
- self.nested_pb = None
self.from_repository.lock_read()
+ mutter("Using fetch logic to copy between %s(%s) and %s(%s)",
+ self.from_repository, self.from_repository._format,
+ self.to_repository, self.to_repository._format)
try:
- try:
- self.__fetch()
- finally:
- if self.nested_pb is not None:
- self.nested_pb.finished()
+ self.__fetch()
finally:
self.from_repository.unlock()
@@ -121,17 +99,19 @@
# assert not missing
self.count_total = 0
self.file_ids_names = {}
- pp = ProgressPhase('Transferring', 4, self.pb)
+ pb = bzrlib.ui.ui_factory.nested_progress_bar()
+ pb.show_pct = pb.show_count = False
try:
- pp.next_phase()
+ pb.update("Finding revisions", 0, 2)
search = self._revids_to_fetch()
if search is None:
return
- self._fetch_everything_for_search(search, pp)
+ pb.update("Fetching revisions", 1, 2)
+ self._fetch_everything_for_search(search)
finally:
- self.pb.clear()
+ pb.finished()
- def _fetch_everything_for_search(self, search, pp):
+ def _fetch_everything_for_search(self, search):
"""Fetch all data for the given set of revisions."""
# The first phase is "file". We pass the progress bar for it directly
# into item_keys_introduced_by, which has more information about how
@@ -146,16 +126,20 @@
raise errors.IncompatibleRepositories(
self.from_repository, self.to_repository,
"different rich-root support")
- self.pb = bzrlib.ui.ui_factory.nested_progress_bar()
+ pb = bzrlib.ui.ui_factory.nested_progress_bar()
try:
+ pb.update("Get stream source")
source = self.from_repository._get_source(
self.to_repository._format)
stream = source.get_stream(search)
from_format = self.from_repository._format
+ pb.update("Inserting stream")
resume_tokens, missing_keys = self.sink.insert_stream(
stream, from_format, [])
if missing_keys:
+ pb.update("Missing keys")
stream = source.get_stream_for_missing_keys(missing_keys)
+ pb.update("Inserting missing keys")
resume_tokens, missing_keys = self.sink.insert_stream(
stream, from_format, resume_tokens)
if missing_keys:
@@ -166,10 +150,10 @@
raise AssertionError(
"second push failed to commit the fetch %r." % (
resume_tokens,))
+ pb.update("Finishing stream")
self.sink.finished()
finally:
- if self.pb is not None:
- self.pb.finished()
+ pb.finished()
def _revids_to_fetch(self):
"""Determines the exact revisions needed from self.from_repository to
=== modified file 'bzrlib/help_topics/__init__.py'
--- a/bzrlib/help_topics/__init__.py 2009-03-12 06:24:39 +0000
+++ b/bzrlib/help_topics/__init__.py 2009-03-13 03:01:14 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006 Canonical Ltd
+# Copyright (C) 2006, 2009 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -299,27 +299,7 @@
See doc/developers/profiling.txt for more information on profiling.
A number of debug flags are also available to assist troubleshooting and
-development.
-
--Dauth Trace authentication sections used.
--Derror Instead of normal error handling, always print a traceback
- on error.
--Devil Capture call sites that do expensive or badly-scaling
- operations.
--Dfetch Trace history copying between repositories.
--Dgraph Trace graph traversal.
--Dhashcache Log every time a working file is read to determine its hash.
--Dhooks Trace hook execution.
--Dhpss Trace smart protocol requests and responses.
--Dhttp Trace http connections, requests and responses
--Dindex Trace major index operations.
--Dknit Trace knit operations.
--Dlock Trace when lockdir locks are taken or released.
--Dmerge Emit information for debugging merges.
--Dpack Emit information about pack operations.
--Dsftp Trace SFTP internals.
-
-These can also be set in the debug_flags configuration variable.
+development. See `bzr help debug-flags`.
"""
_standard_options = \
@@ -748,6 +728,8 @@
'Details on the configuration settings available')
topic_registry.register('conflicts', _load_from_file,
'Types of conflicts and what to do about them')
+topic_registry.register('debug-flags', _load_from_file,
+ 'Options to show or record debug information')
topic_registry.register('log-formats', _load_from_file,
'Details on the logging formats available')
=== added file 'bzrlib/help_topics/en/debug-flags.txt'
--- a/bzrlib/help_topics/en/debug-flags.txt 1970-01-01 00:00:00 +0000
+++ b/bzrlib/help_topics/en/debug-flags.txt 2009-03-12 05:11:05 +0000
@@ -0,0 +1,23 @@
+Debug Flags
+===========
+
+These flags can be passed on the bzr command line or (without the ``-D``
+prefix) put in the ``debug_flags`` variable in ``bazaar.conf``.
+
+-Dauth Trace authentication sections used.
+-Derror Instead of normal error handling, always print a traceback
+ on error.
+-Devil Capture call sites that do expensive or badly-scaling
+ operations.
+-Dfetch Trace history copying between repositories.
+-Dgraph Trace graph traversal.
+-Dhashcache Log every time a working file is read to determine its hash.
+-Dhooks Trace hook execution.
+-Dhpss Trace smart protocol requests and responses.
+-Dhttp Trace http connections, requests and responses
+-Dindex Trace major index operations.
+-Dknit Trace knit operations.
+-Dlock Trace when lockdir locks are taken or released.
+-Dmerge Emit information for debugging merges.
+-Dpack Emit information about pack operations.
+-Dsftp Trace SFTP internals.
=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py 2009-03-12 02:45:17 +0000
+++ b/bzrlib/knit.py 2009-03-12 05:44:43 +0000
@@ -1662,6 +1662,7 @@
* If a requested key did not change any lines (or didn't have any
lines), it may not be mentioned at all in the result.
+ :param pb: Progress bar supplied by caller.
:return: An iterator over (line, key).
"""
if pb is None:
=== modified file 'bzrlib/progress.py'
--- a/bzrlib/progress.py 2009-02-23 15:42:47 +0000
+++ b/bzrlib/progress.py 2009-03-12 07:09:28 +0000
@@ -70,6 +70,11 @@
"""
def __init__(self, parent_task=None, ui_factory=None):
+ """Construct a new progress task.
+
+ Normally you should not call this directly but rather through
+ `ui_factory.nested_progress_bar`.
+ """
self._parent_task = parent_task
self._last_update = 0
self.total_cnt = None
@@ -112,7 +117,9 @@
if self.current_cnt is not None and self.total_cnt:
own_fraction = (float(self.current_cnt) + child_fraction) / self.total_cnt
else:
- own_fraction = None
+ # if this task has no estimation, it just passes on directly
+ # whatever the child has measured...
+ own_fraction = child_fraction
if self._parent_task is None:
return own_fraction
else:
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2009-03-13 03:56:23 +0000
+++ b/bzrlib/repository.py 2009-03-13 05:05:50 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
+# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -2617,6 +2617,7 @@
pass
self.target.fetch(self.source, revision_id=revision_id)
+ @needs_write_lock
def fetch(self, revision_id=None, pb=None, find_ghosts=False,
fetch_spec=None):
"""Fetch the content required to construct revision_id.
@@ -2630,9 +2631,6 @@
:return: None.
"""
from bzrlib.fetch import RepoFetcher
- mutter("Using fetch logic to copy between %s(%s) and %s(%s)",
- self.source, self.source._format, self.target,
- self.target._format)
f = RepoFetcher(to_repository=self.target,
from_repository=self.source,
last_revision=revision_id,
@@ -2851,19 +2849,6 @@
else:
self.target.fetch(self.source, revision_id=revision_id)
- @needs_write_lock
- def fetch(self, revision_id=None, pb=None, find_ghosts=False,
- fetch_spec=None):
- """See InterRepository.fetch()."""
- from bzrlib.fetch import RepoFetcher
- mutter("Using fetch logic to copy between %s(%s) and %s(%s)",
- self.source, self.source._format, self.target, self.target._format)
- f = RepoFetcher(to_repository=self.target,
- from_repository=self.source,
- last_revision=revision_id,
- fetch_spec=fetch_spec,
- pb=pb, find_ghosts=find_ghosts)
-
@needs_read_lock
def search_missing_revision_ids(self, revision_id=None, find_ghosts=True):
"""See InterRepository.missing_revision_ids()."""
@@ -2933,19 +2918,6 @@
return False
return are_knits and InterRepository._same_model(source, target)
- @needs_write_lock
- def fetch(self, revision_id=None, pb=None, find_ghosts=False,
- fetch_spec=None):
- """See InterRepository.fetch()."""
- from bzrlib.fetch import RepoFetcher
- mutter("Using fetch logic to copy between %s(%s) and %s(%s)",
- self.source, self.source._format, self.target, self.target._format)
- f = RepoFetcher(to_repository=self.target,
- from_repository=self.source,
- last_revision=revision_id,
- fetch_spec=fetch_spec,
- pb=pb, find_ghosts=find_ghosts)
-
@needs_read_lock
def search_missing_revision_ids(self, revision_id=None, find_ghosts=True):
"""See InterRepository.missing_revision_ids()."""
@@ -3017,8 +2989,6 @@
from bzrlib.fetch import RepoFetcher
fetcher = RepoFetcher(self.target, self.source, revision_id,
pb, find_ghosts, fetch_spec=fetch_spec)
- mutter("Using fetch logic to copy between %s(%s) and %s(%s)",
- self.source, self.source._format, self.target, self.target._format)
if fetch_spec is not None:
if len(list(fetch_spec.heads)) != 1:
raise AssertionError(
@@ -3262,6 +3232,9 @@
my_pb = ui.ui_factory.nested_progress_bar()
pb = my_pb
else:
+ symbol_versioning.warn(
+ symbol_versioning.deprecated_in((1, 14, 0))
+ % "pb parameter to fetch()")
my_pb = None
try:
self._fetch_all_revisions(revision_ids, pb)
@@ -3352,16 +3325,6 @@
real_source = self.source._real_repository
self._real_inter = InterRepository.get(real_source, self.target)
- @needs_write_lock
- def fetch(self, revision_id=None, pb=None, find_ghosts=False,
- fetch_spec=None):
- """See InterRepository.fetch()."""
- # Always fetch using the generic streaming fetch code, to allow
- # streaming fetching from remote servers.
- from bzrlib.fetch import RepoFetcher
- fetcher = RepoFetcher(self.target, self.source, revision_id,
- pb, find_ghosts, fetch_spec=fetch_spec)
-
def copy_content(self, revision_id=None):
self._ensure_real_inter()
self._real_inter.copy_content(revision_id=revision_id)
=== modified file 'bzrlib/smart/medium.py'
--- a/bzrlib/smart/medium.py 2009-03-11 10:22:00 +0000
+++ b/bzrlib/smart/medium.py 2009-03-12 07:26:03 +0000
@@ -741,6 +741,9 @@
self._vendor = vendor
self._write_to = None
self._bzr_remote_path = bzr_remote_path
+ # for the benefit of progress making a short description of this
+ # transport
+ self._scheme = 'bzr+ssh'
def __repr__(self):
return "%s(connected=%r, username=%r, host=%r, port=%r)" % (
=== modified file 'bzrlib/tests/interrepository_implementations/test_fetch.py'
--- a/bzrlib/tests/interrepository_implementations/test_fetch.py 2009-03-10 07:47:23 +0000
+++ b/bzrlib/tests/interrepository_implementations/test_fetch.py 2009-03-12 05:44:43 +0000
@@ -53,10 +53,9 @@
def check_push_rev1(repo):
# ensure the revision is missing.
self.assertRaises(NoSuchRevision, repo.get_revision, 'rev1')
- # fetch with a limit of NULL_REVISION and an explicit progress bar.
+ # fetch with a limit of NULL_REVISION
repo.fetch(tree_a.branch.repository,
- revision_id=NULL_REVISION,
- pb=bzrlib.progress.DummyProgress())
+ revision_id=NULL_REVISION)
# nothing should have been pushed
self.assertFalse(repo.has_revision('rev1'))
# fetch with a default limit (grab everything)
=== modified file 'bzrlib/tests/per_repository/test_fetch.py'
--- a/bzrlib/tests/per_repository/test_fetch.py 2009-03-02 03:38:07 +0000
+++ b/bzrlib/tests/per_repository/test_fetch.py 2009-03-11 07:55:14 +0000
@@ -44,7 +44,6 @@
raise TestSkipped('Cannot fetch from model2 to model1')
repo.fetch(tree_a.branch.repository,
revision_id=None)
- ## pb=bzrlib.progress.DummyProgress())
def test_fetch_to_knit3(self):
# create a repository of the sort we are testing.
=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py 2009-02-27 01:02:40 +0000
+++ b/bzrlib/tests/test_repository.py 2009-03-13 05:40:03 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2007, 2008 Canonical Ltd
+# Copyright (C) 2006, 2007, 2008, 2009 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -1120,24 +1120,3 @@
self.assertTrue(new_pack.inventory_index._optimize_for_size)
self.assertTrue(new_pack.text_index._optimize_for_size)
self.assertTrue(new_pack.signature_index._optimize_for_size)
-
-
-class TestInterDifferingSerializer(TestCaseWithTransport):
-
- def test_progress_bar(self):
- tree = self.make_branch_and_tree('tree')
- tree.commit('rev1', rev_id='rev-1')
- tree.commit('rev2', rev_id='rev-2')
- tree.commit('rev3', rev_id='rev-3')
- repo = self.make_repository('repo')
- inter_repo = repository.InterDifferingSerializer(
- tree.branch.repository, repo)
- pb = progress.InstrumentedProgress(to_file=StringIO())
- pb.never_throttle = True
- inter_repo.fetch('rev-1', pb)
- self.assertEqual('Transferring revisions', pb.last_msg)
- self.assertEqual(1, pb.last_cnt)
- self.assertEqual(1, pb.last_total)
- inter_repo.fetch('rev-3', pb)
- self.assertEqual(2, pb.last_cnt)
- self.assertEqual(2, pb.last_total)
=== modified file 'bzrlib/tests/test_ui.py'
--- a/bzrlib/tests/test_ui.py 2009-02-23 15:29:35 +0000
+++ b/bzrlib/tests/test_ui.py 2009-03-12 07:13:53 +0000
@@ -28,6 +28,7 @@
from bzrlib.progress import (
DotsProgressBar,
ProgressBarStack,
+ ProgressTask,
TTYProgressBar,
)
from bzrlib.symbol_versioning import (
@@ -43,7 +44,10 @@
CLIUIFactory,
SilentUIFactory,
)
-from bzrlib.ui.text import TextUIFactory
+from bzrlib.ui.text import (
+ TextProgressView,
+ TextUIFactory,
+ )
class UITests(TestCase):
@@ -249,3 +253,63 @@
pb.tick()
finally:
pb.finished()
+
+
+class TestTextProgressView(TestCase):
+ """Tests for text display of progress bars.
+ """
+ # XXX: These might be a bit easier to write if the rendering and
+ # state-maintaining parts of TextProgressView were more separate, and if
+ # the progress task called back directly to its own view not to the ui
+ # factory. -- mbp 20090312
+
+ def _make_factory(self):
+ out = StringIO()
+ uif = TextUIFactory(stderr=out)
+ uif._progress_view._width = 80
+ return out, uif
+
+ def test_render_progress_easy(self):
+ """Just one task and one quarter done"""
+ out, uif = self._make_factory()
+ task = uif.nested_progress_bar()
+ task.update('reticulating splines', 5, 20)
+ self.assertEqual(
+'\r[####/ ] reticulating splines 5/20 \r'
+ , out.getvalue())
+
+ def test_render_progress_nested(self):
+ """Tasks proportionally contribute to overall progress"""
+ out, uif = self._make_factory()
+ task = uif.nested_progress_bar()
+ task.update('reticulating splines', 0, 2)
+ task2 = uif.nested_progress_bar()
+ task2.update('stage2', 1, 2)
+ # so we're in the first half of the main task, and half way through
+ # that
+ self.assertEqual(
+r'[####\ ] reticulating splines:stage2 1/2'
+ , uif._progress_view._render_line())
+ # if the nested task is complete, then we're all the way through the
+ # first half of the overall work
+ task2.update('stage2', 2, 2)
+ self.assertEqual(
+r'[#########| ] reticulating splines:stage2 2/2'
+ , uif._progress_view._render_line())
+
+ def test_render_progress_sub_nested(self):
+ """Intermediate tasks don't mess up calculation."""
+ out, uif = self._make_factory()
+ task_a = uif.nested_progress_bar()
+ task_a.update('a', 0, 2)
+ task_b = uif.nested_progress_bar()
+ task_b.update('b')
+ task_c = uif.nested_progress_bar()
+ task_c.update('c', 1, 2)
+ # the top-level task is in its first half; the middle one has no
+ # progress indication, just a label; and the bottom one is half done,
+ # so the overall fraction is 1/4
+ self.assertEqual(
+ r'[####| ] a:b:c 1/2'
+ , uif._progress_view._render_line())
+
=== modified file 'bzrlib/ui/text.py'
--- a/bzrlib/ui/text.py 2009-03-10 06:55:49 +0000
+++ b/bzrlib/ui/text.py 2009-03-12 07:26:03 +0000
@@ -86,7 +86,8 @@
This may update a progress bar, spinner, or similar display.
By default it does nothing.
"""
- self._progress_view.show_transport_activity(byte_count)
+ self._progress_view._show_transport_activity(transport,
+ direction, byte_count)
def _progress_updated(self, task):
"""A task has been updated and wants to be displayed.
@@ -130,7 +131,6 @@
self._last_repaint = 0
# time we last got information about transport activity
self._transport_update_time = 0
- self._task_fraction = None
self._last_task = None
self._total_byte_count = 0
self._bytes_since_update = 0
@@ -154,10 +154,13 @@
# to have what looks like an incomplete progress bar.
spin_str = r'/-\|'[self._spin_pos % 4]
self._spin_pos += 1
- f = self._task_fraction or 0
cols = 20
- # number of markers highlighted in bar
- markers = int(round(float(cols) * f)) - 1
+ if self._last_task is None:
+ completion_fraction = 0
+ else:
+ completion_fraction = \
+ self._last_task._overall_completion_fraction() or 0
+ markers = int(round(float(cols) * completion_fraction)) - 1
bar_str = '[' + ('#' * markers + spin_str).ljust(cols) + '] '
return bar_str
elif self._last_task.show_spinner:
@@ -177,7 +180,6 @@
s = ' %d' % (task.current_cnt)
else:
s = ''
- self._task_fraction = task._overall_completion_fraction()
# compose all the parent messages
t = task
m = task.msg
@@ -187,35 +189,41 @@
m = t.msg + ':' + m
return m + s
- def _repaint(self):
+ def _render_line(self):
bar_string = self._render_bar()
if self._last_task:
task_msg = self._format_task(self._last_task)
else:
task_msg = ''
trans = self._last_transport_msg
- if trans and task_msg:
+ if trans:
trans += ' | '
- s = (bar_string
- + trans
- + task_msg
- )
+ return (bar_string + trans + task_msg)
+
+ def _repaint(self):
+ s = self._render_line()
self._show_line(s)
self._have_output = True
def show_progress(self, task):
+ """Called by the task object when it has changed.
+
+ :param task: The top task object; its parents are also included
+ by following links.
+ """
+ must_update = task is not self._last_task
self._last_task = task
now = time.time()
- if now < self._last_repaint + 0.1:
+ if (not must_update) and (now < self._last_repaint + 0.1):
return
- if now > self._transport_update_time + 5:
+ if now > self._transport_update_time + 10:
# no recent activity; expire it
self._last_transport_msg = ''
self._last_repaint = now
self._repaint()
- def show_transport_activity(self, byte_count):
- """Called by transports as they do IO.
+ def _show_transport_activity(self, transport, direction, byte_count):
+ """Called by transports via the ui_factory, as they do IO.
This may update a progress bar, spinner, or similar display.
By default it does nothing.
@@ -232,8 +240,15 @@
# guard against clock stepping backwards, and don't update too
# often
rate = self._bytes_since_update / (now - self._transport_update_time)
- msg = ("%6dkB @ %4dkB/s" %
- (self._total_byte_count>>10, int(rate)>>10,))
+ scheme = getattr(transport, '_scheme', None) or repr(transport)
+ if direction == 'read':
+ dir_char = '>'
+ elif direction == 'write':
+ dir_char = '<'
+ else:
+ dir_char = '?'
+ msg = ("%.7s %s %6dkB %5dkB/s" %
+ (scheme, dir_char, self._total_byte_count>>10, int(rate)>>10,))
self._transport_update_time = now
self._last_repaint = now
self._bytes_since_update = 0
=== modified file 'bzrlib/versionedfile.py'
--- a/bzrlib/versionedfile.py 2009-03-11 07:59:06 +0000
+++ b/bzrlib/versionedfile.py 2009-03-12 05:44:43 +0000
@@ -1484,7 +1484,7 @@
"""See VersionedFile.iter_lines_added_or_present_in_versions()."""
for i, (key,) in enumerate(keys):
if pb is not None:
- pb.update("iterating texts", i, len(keys))
+ pb.update("Finding changed lines", i, len(keys))
for l in self._get_lines(key):
yield (l, key)
=== modified file 'doc/developers/HACKING.txt'
--- a/doc/developers/HACKING.txt 2009-03-03 05:02:36 +0000
+++ b/doc/developers/HACKING.txt 2009-03-12 08:07:42 +0000
@@ -824,6 +824,39 @@
should be only in the command-line tool.
+Progress and Activity Indications
+---------------------------------
+
+bzrlib has a way for code to display to the user that stuff is happening
+during a long operation. There are two particular types: *activity* which
+means that IO is happening on a Transport, and *progress* which means that
+higher-level application work is occurring. Both are drawn together by
+the `ui_factory`.
+
+Transport objects are responsible for calling `report_transport_activity`
+when they do IO.
+
+Progress uses a model/view pattern: application code acts on a
+`ProgressTask` object, which notifies the UI when it needs to be
+displayed. Progress tasks form a stack. To create a new progress task on
+top of the stack, call `bzrlib.ui.ui_factory.nested_progress_bar()`, then
+call `update()` on the returned ProgressTask. It can be updated with just
+a text description, with a numeric count, or with a numeric count and
+expected total count. If an expected total count is provided the view
+can show the progress moving along towards the expected total.
+
+The user should call `finish` on the `ProgressTask` when the logical
+operation has finished, so it can be removed from the stack.
+
+Progress tasks have a complex relatioship with generators: it's a very
+good place to use them, but because python2.4 does not allow ``finally``
+blocks in generators it's hard to clean them up properly. In this case
+it's probably better to have the code calling the generator allocate a
+progress task for its use and then call `finalize` when it's done, which
+will close it if it was not already closed. The generator should also
+finish the progress task when it exits, because it may otherwise be a long
+time until the finally block runs.
+
Displaying help
===============
More information about the bazaar-commits
mailing list