Rev 3913: (jam) Part of bug #153786, the autopack logic can now restart. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Dec 19 18:53:24 GMT 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3913
revision-id: pqm at pqm.ubuntu.com-20081219185318-yy8xjch1yej1y59r
parent: pqm at pqm.ubuntu.com-20081219171459-521qbou7ho7g297f
parent: john at arbash-meinel.com-20081219181236-ufw7vqpi56v8mzj0
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-12-19 18:53:18 +0000
message:
  (jam) Part of bug #153786, the autopack logic can now restart.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
  bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
  bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
  bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
    ------------------------------------------------------------
    revno: 3789.2.29
    revision-id: john at arbash-meinel.com-20081219181236-ufw7vqpi56v8mzj0
    parent: john at arbash-meinel.com-20081219181134-4lm0bs4ogsfvwlpr
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Fri 2008-12-19 12:12:36 -0600
    message:
      RetryWithNewPacks requires another argument.
    modified:
      bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
    ------------------------------------------------------------
    revno: 3789.2.28
    revision-id: john at arbash-meinel.com-20081219181134-4lm0bs4ogsfvwlpr
    parent: john at arbash-meinel.com-20081219164804-5hgw636eeadadxwm
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Fri 2008-12-19 12:11:34 -0600
    message:
      We don't actually have a transport yet, so we can't use it as context.
    modified:
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
    ------------------------------------------------------------
    revno: 3789.2.27
    revision-id: john at arbash-meinel.com-20081219164804-5hgw636eeadadxwm
    parent: john at arbash-meinel.com-20081216150741-mp88ad7yjfok68yi
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Fri 2008-12-19 10:48:04 -0600
    message:
      Add some context information to the Retry exceptions.
      
      Just in case one of them leaks out into the 'real world'.
    modified:
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
    ------------------------------------------------------------
    revno: 3789.2.26
    revision-id: john at arbash-meinel.com-20081216150741-mp88ad7yjfok68yi
    parent: john at arbash-meinel.com-20081216145829-fqis79ouytgbcj4t
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Tue 2008-12-16 09:07:41 -0600
    message:
      Change the code so that we expect _reload_func to divert the flow by raising.
      
      It isn't a perfect solution, but it makes it works for autopack, and getting
      it to work for all other possibilities is difficult, and not strictly worthwhile.
    modified:
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
    ------------------------------------------------------------
    revno: 3789.2.25
    revision-id: john at arbash-meinel.com-20081216145829-fqis79ouytgbcj4t
    parent: john at arbash-meinel.com-20081028174341-0k5jodd44m9llx7w
    parent: pqm at pqm.ubuntu.com-20081212134729-rphmydb7slbgqmeu
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Tue 2008-12-16 08:58:29 -0600
    message:
      Merge in bzr.dev, pull out some of the retry on copy_revision_texts code.
    added:
      bzrlib/_chunks_to_lines_py.py  _chunks_to_lines_py.-20081211024848-6uc3mtuje8j14l60-1
      bzrlib/_chunks_to_lines_pyx.pyx _chunks_to_lines_pyx-20081211021736-op7n8vrxgrd8snfi-1
      bzrlib/fifo_cache.py           fifo_cache.py-20081209212307-31ffjwvteyvmydnf-1
      bzrlib/foreign.py              foreign.py-20081112170002-olsxmandkk8qyfuq-1
      bzrlib/shelf.py                prepare_shelf.py-20081005181341-n74qe6gu1e65ad4v-1
      bzrlib/shelf_ui.py             shelver.py-20081005210102-33worgzwrtdw0yrm-1
      bzrlib/smart/packrepository.py packrepository.py-20080527041253-a16a8qp4vy8qh8y6-1
      bzrlib/tests/blackbox/test_shelve.py test_ls_shelf.py-20081202053526-thlo8yt0pi1cgor1-1
      bzrlib/tests/per_repository/test_add_inventory_by_delta.py test_add_inventory_d-20081013002626-rut81igtlqb4590z-1
      bzrlib/tests/test__chunks_to_lines.py test__chunks_to_line-20081211024848-6uc3mtuje8j14l60-2
      bzrlib/tests/test_fifo_cache.py test_fifo_cache.py-20081209212307-31ffjwvteyvmydnf-2
      bzrlib/tests/test_foreign.py   test_foreign.py-20081125004048-ywb901edgp9lluxo-1
      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
      contrib/bzr_ssh_path_limiter   bzr_ssh_path_limiter-20081030010544-xjhl0y2i6wyloz8q-1
      contrib/convert_to_1.9.py      convert_to_dev2.py-20081014130524-z1ydl3mq9b4ehlvv-1
      doc/developers/btree_index_prefetch.txt btree_index_request_-20081004155340-2u6apsy53f43f0xn-1
      tools/win32/build_release.py   build_release.py-20081105204355-2ghh5cv01v1x4rzz-1
    modified:
      .bzrignore                     bzrignore-20050311232317-81f7b71efa2db11a
      Makefile                       Makefile-20050805140406-d96e3498bb61c5bb
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzr                            bzr.py-20050313053754-5485f144c7006fa6
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
      bzrlib/_dirstate_helpers_c.h   _dirstate_helpers_c.-20070802205935-hqo9yzuzjix271dd-1
      bzrlib/_patiencediff_c.c       _patiencediff_c.c-20070721205602-q3imkipwlgagp3cy-1
      bzrlib/_readdir_pyx.pyx        readdir.pyx-20060609152855-rm6v321vuaqyh9tu-1
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/branchbuilder.py        branchbuilder.py-20070427022007-zlxpqz2lannhk6y8-1
      bzrlib/btree_index.py          index.py-20080624222253-p0x5f92uyh5hw734-7
      bzrlib/bugtracker.py           bugtracker.py-20070410073305-vu1vu1qosjurg8kb-1
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/bundle/serializer/v4.py v10.py-20070611062757-5ggj7k18s9dej0fr-1
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/commit.py               commit.py-20050511101309-79ec1a0168e0e825
      bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
      bzrlib/delta.py                delta.py-20050729221636-54cf14ef94783d0a
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/help_topics/en/hooks.txt hooks.txt-20070830033044-xxu2rced13f72dka-1
      bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
      bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/lockable_files.py       control_files.py-20051111201905-bb88546e799d669f
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
      bzrlib/lru_cache.py            lru_cache.py-20070119165515-tlw203kuwh0id5gv-1
      bzrlib/merge.py                merge.py-20050513021216-953b65a438527106
      bzrlib/msgeditor.py            msgeditor.py-20050901111708-ef6d8de98f5d8f2f
      bzrlib/mutabletree.py          mutabletree.py-20060906023413-4wlkalbdpsxi2r4y-2
      bzrlib/option.py               option.py-20051014052914-661fb36e76e7362f
      bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
      bzrlib/plugin.py               plugin.py-20050622060424-829b654519533d69
      bzrlib/plugins/launchpad/account.py account.py-20071011033320-50y6vfftywf4yllw-1
      bzrlib/plugins/launchpad/lp_directory.py lp_indirect.py-20070126012204-de5rugwlt22c7u7e-1
      bzrlib/plugins/launchpad/test_account.py test_account.py-20071011033320-50y6vfftywf4yllw-2
      bzrlib/push.py                 push.py-20080606021927-5fe39050e8xne9un-1
      bzrlib/python-compat.h         pythoncompat.h-20080924041409-9kvi0fgtuuqp743j-1
      bzrlib/registry.py             lazy_factory.py-20060809213415-2gfvqadtvdn0phtg-1
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/revisionspec.py         revisionspec.py-20050907152633-17567659fd5c0ddb
      bzrlib/revisiontree.py         revisiontree.py-20060724012533-bg8xyryhxd0o0i0h-1
      bzrlib/smart/request.py        request.py-20061108095550-gunadhxmzkdjfeek-1
      bzrlib/smart/vfs.py            vfs.py-20061108095550-gunadhxmzkdjfeek-2
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/__init__.py __init__.py-20051128053524-eba30d8255e08dc3
      bzrlib/tests/blackbox/test_bound_branches.py test_bound_branches.py-20051109215527-2373188ad566c205
      bzrlib/tests/blackbox/test_breakin.py test_breakin.py-20070424043903-qyy6zm4pj3h4sbp3-1
      bzrlib/tests/blackbox/test_commit.py test_commit.py-20060212094538-ae88fc861d969db0
      bzrlib/tests/blackbox/test_diff.py test_diff.py-20060110203741-aa99ac93e633d971
      bzrlib/tests/blackbox/test_info.py test_info.py-20060215045507-bbdd2d34efab9e0a
      bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
      bzrlib/tests/blackbox/test_ls.py test_ls.py-20060712232047-0jraqpecwngee12y-1
      bzrlib/tests/blackbox/test_nick.py test_nick.py-20061105141046-p7zovcsit44uj4w9-1
      bzrlib/tests/blackbox/test_pull.py test_pull.py-20051201144907-64959364f629947f
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
      bzrlib/tests/blackbox/test_revision_info.py test_revision_info.py-20050917162600-21dab3877aa348d7
      bzrlib/tests/blackbox/test_send.py test_bundle.py-20060616222707-c21c8b7ea5ef57b1
      bzrlib/tests/blackbox/test_switch.py test_switch.py-20071122111948-0c5en6uz92bwl76h-1
      bzrlib/tests/branch_implementations/__init__.py __init__.py-20060123013057-b12a52c3f361daf4
      bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
      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/bzrdir_implementations/test_bzrdir.py test_bzrdir.py-20060131065642-0ebeca5e30e30866
      bzrlib/tests/commands/test_commit.py test_commit.py-20070913161801-ydrx2k5gmv7k7eiu-1
      bzrlib/tests/http_server.py    httpserver.py-20061012142527-m1yxdj1xazsf8d7s-1
      bzrlib/tests/interrepository_implementations/__init__.py __init__.py-20060220054744-baf49a1f88f17b1a
      bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
      bzrlib/tests/per_repository/__init__.py __init__.py-20060131092037-9564957a7d4a841b
      bzrlib/tests/per_repository/test_add_fallback_repository.py test_add_fallback_re-20080215040003-8w9n4ck9uqdxj18m-1
      bzrlib/tests/per_repository/test_commit_builder.py test_commit_builder.py-20060606110838-76e3ra5slucqus81-1
      bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/per_repository/test_revision.py testrevprops.py-20051013073044-92bc3c68302ce1bf
      bzrlib/tests/per_repository/test_write_group.py test_write_group.py-20070716105516-89n34xtogq5frn0m-1
      bzrlib/tests/test_btree_index.py test_index.py-20080624222253-p0x5f92uyh5hw734-13
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
      bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
      bzrlib/tests/test_graph.py     test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
      bzrlib/tests/test_http.py      testhttp.py-20051018020158-b2eef6e867c514d9
      bzrlib/tests/test_info.py      test_info.py-20070320150933-m0xxm1g7xi9v6noe-1
      bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
      bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
      bzrlib/tests/test_lru_cache.py test_lru_cache.py-20070119165535-hph6rk4h9rzy4180-1
      bzrlib/tests/test_msgeditor.py test_msgeditor.py-20051202041359-920315ec6011ee51
      bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
      bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
      bzrlib/tests/test_permissions.py test_permissions.py-20051215004520-ccf475789c80e80c
      bzrlib/tests/test_plugins.py   plugins.py-20050622075746-32002b55e5e943e9
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
      bzrlib/tests/test_revision.py  testrevision.py-20050804210559-46f5e1eb67b01289
      bzrlib/tests/test_revisionspec.py testrevisionnamespaces.py-20050711050225-8b4af89e6b1efe84
      bzrlib/tests/test_sftp_transport.py testsftp.py-20051027032739-247570325fec7e7e
      bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
      bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
      bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
      bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
      bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
      bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
      bzrlib/tests/tree_implementations/test_tree.py test_tree.py-20061215160206-usu7lwcj8aq2n3br-1
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
      bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
      bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
      bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
      bzrlib/transport/decorator.py  decorator.py-20060402223305-e913a0f25319ab42
      bzrlib/transport/http/__init__.py http_transport.py-20050711212304-506c5fd1059ace96
      bzrlib/transport/http/_pycurl.py pycurlhttp.py-20060110060940-4e2a705911af77a6
      bzrlib/transport/http/_urllib.py _urlgrabber.py-20060113083826-0bbf7d992fbf090c
      bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
      bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
      bzrlib/transport/sftp.py       sftp.py-20051019050329-ab48ce71b7e32dfe
      bzrlib/tree.py                 tree.py-20050309040759-9d5f2496be663e77
      bzrlib/upgrade.py              history2weaves.py-20050818063535-e7d319791c19a8b2
      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/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
      doc/developers/development-repo.txt developmentrepo.txt-20080102200205-raj42k61dch8pjmj-1
      doc/developers/ppa.txt         ppa.txt-20080722055539-606u7t2z32t3ae4w-1
      doc/developers/releasing.txt   releasing.txt-20080502015919-fnrcav8fwy8ccibu-1
      doc/en/user-guide/hooks.txt    hooks.txt-20070829200551-7nr6e5a1io6x78uf-1
      doc/en/user-guide/writing_a_plugin.txt writing_a_plugin.txt-20071114035000-q36a9h57ps06uvnl-7
      setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
    ------------------------------------------------------------
    revno: 3789.2.24
    revision-id: john at arbash-meinel.com-20081028174341-0k5jodd44m9llx7w
    parent: john at arbash-meinel.com-20081027202520-50kkcq0eghc69w93
    parent: john at arbash-meinel.com-20081028174135-h1ye1sag9l0jxjwh
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Tue 2008-10-28 12:43:41 -0500
    message:
      Merge the 153786-1 fixes branch and resolve NEWS again.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
    ------------------------------------------------------------
    revno: 3789.2.23
    revision-id: john at arbash-meinel.com-20081027202520-50kkcq0eghc69w93
    parent: john at arbash-meinel.com-20081027201848-m6oepfo8f4jvwf4p
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Mon 2008-10-27 15:25:20 -0500
    message:
      Clarify the comment.
    modified:
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
    ------------------------------------------------------------
    revno: 3789.2.22
    revision-id: john at arbash-meinel.com-20081027201848-m6oepfo8f4jvwf4p
    parent: john at arbash-meinel.com-20081027200542-zy3svo8f55all5sq
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Mon 2008-10-27 15:18:48 -0500
    message:
      We need the Packer class to cleanup if it is getting a Retry it isn't handling.
      
      This is probably not the cleanest way to do it, but if we need Packer.new_pack.abort() to be
      called, or we leave an open file handle around.
    modified:
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
    ------------------------------------------------------------
    revno: 3789.2.21
    revision-id: john at arbash-meinel.com-20081027200542-zy3svo8f55all5sq
    parent: john at arbash-meinel.com-20081027200508-vqp58mp4vyy779aj
    parent: pqm at pqm.ubuntu.com-20081027195553-876pyjww9zmjqj87
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Mon 2008-10-27 15:05:42 -0500
    message:
      Merge bzr.dev 3801, bringing in the readv and remove_pack updates.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/plugin.py               plugin.py-20050622060424-829b654519533d69
      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/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/test_missing.py test_missing.py-20051211212735-a2cf4c1840bb84c4
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
      bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
      bzrlib/win32utils.py           win32console.py-20051021033308-123c6c929d04973d
      doc/en/user-guide/branching_a_project.txt branching_a_project.-20071122141511-0knao2lklsdsvb1q-2
      doc/en/user-guide/core_concepts.txt core_concepts.txt-20071114035000-q36a9h57ps06uvnl-2
      doc/en/user-guide/using_checkouts.txt using_checkouts.txt-20071123055134-k5x4ekduci2lbn36-4
    ------------------------------------------------------------
    revno: 3789.2.20
    revision-id: john at arbash-meinel.com-20081027200508-vqp58mp4vyy779aj
    parent: john at arbash-meinel.com-20081027194435-dya2rm90n7feohqk
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Mon 2008-10-27 15:05:08 -0500
    message:
      The autopack code can now trigger itself to retry when _copy_revision_texts fails.
      
      In the current test, it just realizes that there is nothing it needs to do, and it stops.
      Which is fine for what we want.
    modified:
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
    ------------------------------------------------------------
    revno: 3789.2.19
    revision-id: john at arbash-meinel.com-20081027194435-dya2rm90n7feohqk
    parent: john at arbash-meinel.com-20081026152455-ab2z1w4hfysx8sa6
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Mon 2008-10-27 14:44:35 -0500
    message:
      Refactor to make the tests a bit simpler
    modified:
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
    ------------------------------------------------------------
    revno: 3789.2.18
    revision-id: john at arbash-meinel.com-20081026152455-ab2z1w4hfysx8sa6
    parent: john at arbash-meinel.com-20081026151330-rbwnhhrup7wg60kf
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Sun 2008-10-26 10:24:55 -0500
    message:
      Use the .all_packs() function rather than .packs
    modified:
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
    ------------------------------------------------------------
    revno: 3789.2.17
    revision-id: john at arbash-meinel.com-20081026151330-rbwnhhrup7wg60kf
    parent: john at arbash-meinel.com-20081025153055-u56eg6vkslmzx6qs
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Sun 2008-10-26 10:13:30 -0500
    message:
      Start getting _copy_revision_texts to retry.
      
      There seems to be something weird, where reloading the pack names does get
      the correct value for self._names, but still has the old packs in self._packs.
    modified:
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
    ------------------------------------------------------------
    revno: 3789.2.16
    revision-id: john at arbash-meinel.com-20081025153055-u56eg6vkslmzx6qs
    parent: john at arbash-meinel.com-20081025024257-sbi10z5ddf6rc93r
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: pack_retry_153786
    timestamp: Sat 2008-10-25 10:30:55 -0500
    message:
      Set up failing tests for _copy_revision_texts, _copy_inventory_texts, and _copy_text_texts.
    modified:
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
=== modified file 'NEWS'
--- a/NEWS	2008-12-19 17:14:59 +0000
+++ b/NEWS	2008-12-19 18:53:18 +0000
@@ -74,6 +74,10 @@
       work better with how it splits its requests.
       (John Arbash Meinel, #303538)
 
+    * Pack repositories are now able to reload the pack listing and retry
+      the current operation if another action causes the data to be
+      repacked.  (John Arbash Meinel, #153786)
+
     * ``pull -v`` now respects the log_format configuration variable.
       (Aaron Bentley)
 

=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py	2008-12-12 13:09:26 +0000
+++ b/bzrlib/errors.py	2008-12-19 16:48:04 +0000
@@ -1496,10 +1496,11 @@
 
     internal_error = True
 
-    _fmt = ("Pack files have changed, reload and retry. %(orig_error)s")
+    _fmt = ("Pack files have changed, reload and retry. context: %(context)s"
+            " %(orig_error)s")
 
-    def __init__(self, reload_occurred, exc_info):
-        """create a new RestartWithNewPacks error.
+    def __init__(self, context, reload_occurred, exc_info):
+        """create a new RetryWithNewPacks error.
 
         :param reload_occurred: Set to True if we know that the packs have
             already been reloaded, and we are failing because of an in-memory
@@ -1518,6 +1519,19 @@
         #       RetryWithNewPacks also not being caught
 
 
+class RetryAutopack(RetryWithNewPacks):
+    """Raised when we are autopacking and we find a missing file.
+
+    Meant as a signaling exception, to tell the autopack code it should try
+    again.
+    """
+
+    internal_error = True
+
+    _fmt = ("Pack files have changed, reload and try autopack again."
+            " context: %(context)s %(orig_error)s")
+
+
 class NoSuchExportFormat(BzrError):
     
     _fmt = "Export format %(format)r not supported"

=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2008-12-11 03:18:52 +0000
+++ b/bzrlib/knit.py	2008-12-19 18:11:34 +0000
@@ -2594,7 +2594,8 @@
                     # If we don't have a _reload_func there is nothing that can
                     # be done
                     raise
-                raise errors.RetryWithNewPacks(reload_occurred=True,
+                raise errors.RetryWithNewPacks(index,
+                                               reload_occurred=True,
                                                exc_info=sys.exc_info())
             try:
                 reader = pack.make_readv_reader(transport, path, offsets)
@@ -2605,7 +2606,8 @@
                 # missing on disk, we need to trigger a reload, and start over.
                 if self._reload_func is None:
                     raise
-                raise errors.RetryWithNewPacks(reload_occurred=False,
+                raise errors.RetryWithNewPacks(transport.abspath(path),
+                                               reload_occurred=False,
                                                exc_info=sys.exc_info())
 
     def set_writer(self, writer, index, transport_packname):

=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2008-12-01 19:07:21 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2008-12-19 16:48:04 +0000
@@ -14,6 +14,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+import sys
+
 from bzrlib.lazy_import import lazy_import
 lazy_import(globals(), """
 from itertools import izip
@@ -555,7 +557,8 @@
 class Packer(object):
     """Create a pack from packs."""
 
-    def __init__(self, pack_collection, packs, suffix, revision_ids=None):
+    def __init__(self, pack_collection, packs, suffix, revision_ids=None,
+                 reload_func=None):
         """Create a Packer.
 
         :param pack_collection: A RepositoryPackCollection object where the
@@ -563,6 +566,9 @@
         :param packs: The packs to combine.
         :param suffix: The suffix to use on the temporary files for the pack.
         :param revision_ids: Revision ids to limit the pack to.
+        :param reload_func: A function to call if a pack file/index goes
+            missing. The side effect of calling this function should be to
+            update self.packs. See also AggregateIndex
         """
         self.packs = packs
         self.suffix = suffix
@@ -570,6 +576,7 @@
         # The pack object we are creating.
         self.new_pack = None
         self._pack_collection = pack_collection
+        self._reload_func = reload_func
         # The index layer keys for the revisions being copied. None for 'all
         # objects'.
         self._revision_keys = None
@@ -629,8 +636,9 @@
         # XXX: - duplicate code warning with start_write_group; fix before
         #      considering 'done'.
         if self._pack_collection._new_pack is not None:
-            raise errors.BzrError('call to create_pack_from_packs while '
-                'another pack is being written.')
+            raise errors.BzrError('call to %s.pack() while another pack is'
+                                  ' being written.'
+                                  % (self.__class__.__name__,))
         if self.revision_ids is not None:
             if len(self.revision_ids) == 0:
                 # silly fetch request.
@@ -861,8 +869,13 @@
             # copy the data
             pack_obj = index_map[index]
             transport, path = pack_obj.access_tuple()
-            reader = pack.make_readv_reader(transport, path,
-                [offset[0:2] for offset in pack_readv_requests])
+            try:
+                reader = pack.make_readv_reader(transport, path,
+                    [offset[0:2] for offset in pack_readv_requests])
+            except errors.NoSuchFile:
+                if self._reload_func is not None:
+                    self._reload_func()
+                raise
             for (names, read_func), (_1, _2, (key, eol_flag)) in \
                 izip(reader.iter_records(), pack_readv_requests):
                 raw_data = read_func(None)
@@ -906,7 +919,12 @@
             # copy the data
             pack_obj = index_map[index]
             transport, path = pack_obj.access_tuple()
-            reader = pack.make_readv_reader(transport, path, readv_vector)
+            try:
+                reader = pack.make_readv_reader(transport, path, readv_vector)
+            except errors.NoSuchFile:
+                if self._reload_func is not None:
+                    self._reload_func()
+                raise
             for (names, read_func), (key, eol_flag, references) in \
                 izip(reader.iter_records(), node_vector):
                 raw_data = read_func(None)
@@ -1275,6 +1293,15 @@
 
         :return: True if packing took place.
         """
+        while True:
+            try:
+                return self._do_autopack()
+            except errors.RetryAutopack, e:
+                # If we get a RetryAutopack exception, we should abort the
+                # current action, and retry.
+                pass
+
+    def _do_autopack(self):
         # XXX: Should not be needed when the management of indices is sane.
         total_revisions = self.revision_index.combined_index.key_count()
         total_packs = len(self._names)
@@ -1309,10 +1336,12 @@
             'containing %d revisions. Packing %d files into %d affecting %d'
             ' revisions', self, total_packs, total_revisions, num_old_packs,
             num_new_packs, num_revs_affected)
-        self._execute_pack_operations(pack_operations)
+        self._execute_pack_operations(pack_operations,
+                                      reload_func=self._restart_autopack)
         return True
 
-    def _execute_pack_operations(self, pack_operations, _packer_class=Packer):
+    def _execute_pack_operations(self, pack_operations, _packer_class=Packer,
+                                 reload_func=None):
         """Execute a series of pack operations.
 
         :param pack_operations: A list of [revision_count, packs_to_combine].
@@ -1323,7 +1352,18 @@
             # we may have no-ops from the setup logic
             if len(packs) == 0:
                 continue
-            _packer_class(self, packs, '.autopack').pack()
+            packer = _packer_class(self, packs, '.autopack',
+                                   reload_func=reload_func)
+            try:
+                packer.pack()
+            except errors.RetryWithNewPacks:
+                # An exception is propagating out of this context, make sure
+                # this packer has cleaned up. Packer() doesn't set its new_pack
+                # state into the RepositoryPackCollection object, so we only
+                # have access to it directly here.
+                if packer.new_pack is not None:
+                    packer.new_pack.abort()
+                raise
             for pack in packs:
                 self._remove_pack_from_memory(pack)
         # record the newly available packs and stop advertising the old
@@ -1710,6 +1750,14 @@
             return True
         return False
 
+    def _restart_autopack(self):
+        """Reload the pack names list, and restart the autopack code."""
+        if not self.reload_pack_names():
+            # Re-raise the original exception, because something went missing
+            # and a restart didn't find it
+            raise
+        raise errors.RetryAutopack(self.repo, False, sys.exc_info())
+
     def _clear_obsolete_packs(self):
         """Delete everything from the obsolete-packs directory.
         """

=== modified file 'bzrlib/tests/test_knit.py'
--- a/bzrlib/tests/test_knit.py	2008-12-04 20:41:53 +0000
+++ b/bzrlib/tests/test_knit.py	2008-12-19 18:12:36 +0000
@@ -423,7 +423,7 @@
         try:
             raise _TestException('foobar')
         except _TestException, e:
-            retry_exc = errors.RetryWithNewPacks(reload_occurred=False,
+            retry_exc = errors.RetryWithNewPacks(None, reload_occurred=False,
                                                  exc_info=sys.exc_info())
         return retry_exc
 

=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py	2008-11-27 09:00:45 +0000
+++ b/bzrlib/tests/test_repository.py	2008-12-16 14:58:29 +0000
@@ -758,6 +758,24 @@
         repo = self.make_repository('.', format=format)
         return repo._pack_collection
 
+    def make_packs_and_alt_repo(self, write_lock=False):
+        """Create a pack repo with 3 packs, and access it via a second repo."""
+        tree = self.make_branch_and_tree('.')
+        tree.lock_write()
+        self.addCleanup(tree.unlock)
+        rev1 = tree.commit('one')
+        rev2 = tree.commit('two')
+        rev3 = tree.commit('three')
+        r = repository.Repository.open('.')
+        if write_lock:
+            r.lock_write()
+        else:
+            r.lock_read()
+        self.addCleanup(r.unlock)
+        packs = r._pack_collection
+        packs.ensure_loaded()
+        return tree, r, packs, [rev1, rev2, rev3]
+
     def test__max_pack_count(self):
         """The maximum pack count is a function of the number of revisions."""
         # no revisions - one pack, so that we can have a revision free repo
@@ -926,19 +944,10 @@
         self.assertTrue(pack_1 is packs.get_pack_by_name(name))
 
     def test_reload_pack_names_new_entry(self):
-        tree = self.make_branch_and_tree('.')
-        tree.lock_write()
-        self.addCleanup(tree.unlock)
-        rev1 = tree.commit('one')
-        rev2 = tree.commit('two')
-        r = repository.Repository.open('.')
-        r.lock_read()
-        self.addCleanup(r.unlock)
-        packs = r._pack_collection
-        packs.ensure_loaded()
+        tree, r, packs, revs = self.make_packs_and_alt_repo()
         names = packs.names()
         # Add a new pack file into the repository
-        rev3 = tree.commit('three')
+        rev4 = tree.commit('four')
         new_names = tree.branch.repository._pack_collection.names()
         new_name = set(new_names).difference(names)
         self.assertEqual(1, len(new_name))
@@ -948,20 +957,11 @@
         self.assertTrue(packs.reload_pack_names())
         self.assertEqual(new_names, packs.names())
         # And the repository can access the new revision
-        self.assertEqual({rev3:(rev2,)}, r.get_parent_map([rev3]))
+        self.assertEqual({rev4:(revs[-1],)}, r.get_parent_map([rev4]))
         self.assertFalse(packs.reload_pack_names())
 
     def test_reload_pack_names_added_and_removed(self):
-        tree = self.make_branch_and_tree('.')
-        tree.lock_write()
-        self.addCleanup(tree.unlock)
-        rev1 = tree.commit('one')
-        rev2 = tree.commit('two')
-        r = repository.Repository.open('.')
-        r.lock_read()
-        self.addCleanup(r.unlock)
-        packs = r._pack_collection
-        packs.ensure_loaded()
+        tree, r, packs, revs = self.make_packs_and_alt_repo()
         names = packs.names()
         # Now repack the whole thing
         tree.branch.repository.pack()
@@ -970,9 +970,26 @@
         self.assertEqual(names, packs.names())
         self.assertTrue(packs.reload_pack_names())
         self.assertEqual(new_names, packs.names())
-        self.assertEqual({rev2:(rev1,)}, r.get_parent_map([rev2]))
+        self.assertEqual({revs[-1]:(revs[-2],)}, r.get_parent_map([revs[-1]]))
         self.assertFalse(packs.reload_pack_names())
 
+    def test_autopack_reloads_and_stops(self):
+        tree, r, packs, revs = self.make_packs_and_alt_repo(write_lock=True)
+        # After we have determined what needs to be autopacked, trigger a
+        # full-pack via the other repo which will cause us to re-evaluate and
+        # decide we don't need to do anything
+        orig_execute = packs._execute_pack_operations
+        def _munged_execute_pack_ops(*args, **kwargs):
+            tree.branch.repository.pack()
+            return orig_execute(*args, **kwargs)
+        packs._execute_pack_operations = _munged_execute_pack_ops
+        packs._max_pack_count = lambda x: 1
+        packs.pack_distribution = lambda x: [10]
+        self.assertFalse(packs.autopack())
+        self.assertEqual(1, len(packs.names()))
+        self.assertEqual(tree.branch.repository._pack_collection.names(),
+                         packs.names())
+
 
 class TestPack(TestCaseWithTransport):
     """Tests for the Pack object."""




More information about the bazaar-commits mailing list