Rev 3364: Reconfigure can convert a branch to use a shared repo, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sat Apr 12 09:48:50 BST 2008


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

------------------------------------------------------------
revno: 3364
revision-id:pqm at pqm.ubuntu.com-20080412084839-344825k3wbmbzzzf
parent: pqm at pqm.ubuntu.com-20080411111440-f12xc0wel9kail53
parent: aaron at aaronbentley.com-20080412064635-fs97gk4682bhefnf
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2008-04-12 09:48:39 +0100
message:
  Reconfigure can convert a branch to use a shared repo,
  	or to be standalone
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
  bzrlib/reconfigure.py          reconfigure.py-20070908040425-6ykgo7escxhyrg9p-1
  bzrlib/tests/blackbox/test_reconfigure.py test_reconfigure.py-20070908173426-khfo5fi2rgzgtwj3-1
  bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
    ------------------------------------------------------------
    revno: 3311.2.9
    revision-id:aaron at aaronbentley.com-20080412064635-fs97gk4682bhefnf
    parent: aaron at aaronbentley.com-20080412064013-eolsyz9mact6i5o6
    parent: pqm at pqm.ubuntu.com-20080411111440-f12xc0wel9kail53
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.reconfigure3
    timestamp: Sat 2008-04-12 02:46:35 -0400
    message:
      merge bzr.dev
    added:
      bzrlib/tests/test_mutabletree.py test_mutabletree.py-20080405014429-2v0cdi3re320p8db-1
      doc/developers/integration.txt integration.txt-20080404022341-2lorxocp1in07zij-1
      doc/developers/plugin-api.txt  pluginapi.txt-20080229110225-q2j5y4agqhlkjn0s-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/annotate.py             annotate.py-20050922133147-7c60541d2614f022
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/commands.py             bzr.py-20050309040720-d10f4714595cf8c3
      bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/help_topics/en/hooks.txt hooks.txt-20070830033044-xxu2rced13f72dka-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/multiparent.py          __init__.py-20070410133617-n1jdhcc1n1mibarp-1
      bzrlib/mutabletree.py          mutabletree.py-20060906023413-4wlkalbdpsxi2r4y-2
      bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
      bzrlib/plugin.py               plugin.py-20050622060424-829b654519533d69
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-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/revisiontree.py         revisiontree.py-20060724012533-bg8xyryhxd0o0i0h-1
      bzrlib/smart/branch.py         branch.py-20061124031907-mzh3pla28r83r97f-1
      bzrlib/smart/client.py         client.py-20061116014825-2k6ada6xgulslami-1
      bzrlib/smart/medium.py         medium.py-20061103051856-rgu2huy59fkz902q-1
      bzrlib/smart/protocol.py       protocol.py-20061108035435-ot0lstk2590yqhzr-1
      bzrlib/smart/request.py        request.py-20061108095550-gunadhxmzkdjfeek-1
      bzrlib/store/revision/knit.py  knit.py-20060303020652-de5fa299e941a3c7
      bzrlib/store/versioned/__init__.py weavestore.py-20050907094258-88262e0434babab9
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/test_status.py teststatus.py-20050712014354-508855eb9f29f7dc
      bzrlib/tests/branch_implementations/test_hooks.py test_hooks.py-20070129154855-blhpwxmvjs07waei-1
      bzrlib/tests/bzrdir_implementations/__init__.py __init__.py-20060131065642-34c39b54f42dd048
      bzrlib/tests/bzrdir_implementations/test_bzrdir.py test_bzrdir.py-20060131065642-0ebeca5e30e30866
      bzrlib/tests/interversionedfile_implementations/__init__.py __init__.py-20060302012326-981af525594d02ed
      bzrlib/tests/repository_implementations/test_check_reconcile.py test_broken.py-20070928125406-62236394w0jpbpd6-2
      bzrlib/tests/repository_implementations/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
      bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/revisionstore_implementations/test_all.py test_all.py-20060303020702-9b2d4c1d75407f31
      bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
      bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
      bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
      bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
      bzrlib/tests/test_merge.py     testmerge.py-20050905070950-c1b5aa49ff911024
      bzrlib/tests/test_plugins.py   plugins.py-20050622075746-32002b55e5e943e9
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
      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_store.py     teststore.py-20050826022702-f6caadb647395769
      bzrlib/tests/test_subsume.py   test_subsume.py-20060927040024-tsvh4pchajoayymg-1
      bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
      bzrlib/tests/test_weave.py     testknit.py-20050627023648-9833cc5562ffb785
      bzrlib/tests/workingtree_implementations/test_commit.py test_commit.py-20060421013633-1610ec2331c8190f
      bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
      bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
      bzrlib/transport/sftp.py       sftp.py-20051019050329-ab48ce71b7e32dfe
      bzrlib/transport/ssh.py        ssh.py-20060824042150-0s9787kng6zv1nwq-1
      bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
      bzrlib/weave.py                knit.py-20050627021749-759c29984154256b
      bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
      doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
      doc/developers/index.txt       index.txt-20070508041241-qznziunkg0nffhiw-1
      doc/en/user-guide/controlling_registration.txt controlling_registra-20071121073725-0corxykv5irjal00-3
      doc/en/user-guide/core_concepts.txt core_concepts.txt-20071114035000-q36a9h57ps06uvnl-2
    ------------------------------------------------------------
    revno: 3311.2.8
    revision-id:aaron at aaronbentley.com-20080412064013-eolsyz9mact6i5o6
    parent: aaron at aaronbentley.com-20080412063715-1mu71joofp00j8o4
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.reconfigure3
    timestamp: Sat 2008-04-12 02:40:13 -0400
    message:
      NEWS fix
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3311.2.7
    revision-id:aaron at aaronbentley.com-20080412063715-1mu71joofp00j8o4
    parent: aaron at aaronbentley.com-20080412054807-47yd7dgjufa0nf98
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.reconfigure3
    timestamp: Sat 2008-04-12 02:37:15 -0400
    message:
      Get head preservation under test
    modified:
      bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
    ------------------------------------------------------------
    revno: 3311.2.6
    revision-id:aaron at aaronbentley.com-20080412054807-47yd7dgjufa0nf98
    parent: aaron at aaronbentley.com-20080406051657-3qi1bhiiwkg5cdri
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.reconfigure3
    timestamp: Sat 2008-04-12 01:48:07 -0400
    message:
      rename 'sharing' to 'use-shared'
    modified:
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/reconfigure.py          reconfigure.py-20070908040425-6ykgo7escxhyrg9p-1
      bzrlib/tests/blackbox/test_reconfigure.py test_reconfigure.py-20070908173426-khfo5fi2rgzgtwj3-1
      bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
    ------------------------------------------------------------
    revno: 3311.2.5
    revision-id:aaron at aaronbentley.com-20080406051657-3qi1bhiiwkg5cdri
    parent: aaron at aaronbentley.com-20080406044417-v6lch0yugh7d1vtk
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.reconfigure3
    timestamp: Sun 2008-04-06 01:16:57 -0400
    message:
      Implement reconfigure --standalone and --sharing
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/tests/blackbox/test_reconfigure.py test_reconfigure.py-20070908173426-khfo5fi2rgzgtwj3-1
    ------------------------------------------------------------
    revno: 3311.2.4
    revision-id:aaron at aaronbentley.com-20080406044417-v6lch0yugh7d1vtk
    parent: aaron at aaronbentley.com-20080406033530-uhnv0hmgci025stq
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.reconfigure3
    timestamp: Sun 2008-04-06 00:44:17 -0400
    message:
      Implement conversion to standalone
    modified:
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/reconfigure.py          reconfigure.py-20070908040425-6ykgo7escxhyrg9p-1
      bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
    ------------------------------------------------------------
    revno: 3311.2.3
    revision-id:aaron at aaronbentley.com-20080406033530-uhnv0hmgci025stq
    parent: aaron at aaronbentley.com-20080406033414-bghccvp8kk2nt1av
    parent: pqm at pqm.ubuntu.com-20080404122038-852408u460mitk5y
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.reconfigure3
    timestamp: Sat 2008-04-05 23:35:30 -0400
    message:
      Merge with bzr.dev
    added:
      bzrlib/transport/nosmart.py    nosmart.py-20080402095843-6ib17idympwy1zkr-1
    renamed:
      bzrlib/tests/test_revisionnamespaces.py => bzrlib/tests/test_revisionspec.py testrevisionnamespaces.py-20050711050225-8b4af89e6b1efe84
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzr                            bzr.py-20050313053754-5485f144c7006fa6
      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/config.py               config.py-20051011043216-070c74f4e9e338e8
      bzrlib/doc/api/__init__.py     __init__.py-20051224020744-7b87d590843855bc
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
      bzrlib/mail_client.py          mail_client.py-20070809192806-vuxt3t19srtpjpdn-1
      bzrlib/plugin.py               plugin.py-20050622060424-829b654519533d69
      bzrlib/plugins/launchpad/lp_directory.py lp_indirect.py-20070126012204-de5rugwlt22c7u7e-1
      bzrlib/reconcile.py            reweave_inventory.py-20051108164726-1e5e0934febac06e
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-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/revision.py             revision.py-20050309040759-e77802c08f3999d5
      bzrlib/revisionspec.py         revisionspec.py-20050907152633-17567659fd5c0ddb
      bzrlib/smart/branch.py         branch.py-20061124031907-mzh3pla28r83r97f-1
      bzrlib/smart/bzrdir.py         bzrdir.py-20061122024551-ol0l0o0oofsu9b3t-1
      bzrlib/smart/client.py         client.py-20061116014825-2k6ada6xgulslami-1
      bzrlib/smart/medium.py         medium.py-20061103051856-rgu2huy59fkz902q-1
      bzrlib/smart/protocol.py       protocol.py-20061108035435-ot0lstk2590yqhzr-1
      bzrlib/smart/repository.py     repository.py-20061128022038-vr5wy5bubyb8xttk-1
      bzrlib/smart/request.py        request.py-20061108095550-gunadhxmzkdjfeek-1
      bzrlib/smart/server.py         server.py-20061110062051-chzu10y32vx8gvur-1
      bzrlib/smart/vfs.py            vfs.py-20061108095550-gunadhxmzkdjfeek-2
      bzrlib/status.py               status.py-20050505062338-431bfa63ec9b19e6
      bzrlib/tests/TestUtil.py       TestUtil.py-20050824080200-5f70140a2d938694
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/test_serve.py test_serve.py-20060913064329-8t2pvmsikl4s3xhl-1
      bzrlib/tests/blackbox/test_switch.py test_switch.py-20071122111948-0c5en6uz92bwl76h-1
      bzrlib/tests/blackbox/test_version.py test_version.py-20070312060045-ol7th9z035r3im3d-1
      bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
      bzrlib/tests/interrepository_implementations/__init__.py __init__.py-20060220054744-baf49a1f88f17b1a
      bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
      bzrlib/tests/interversionedfile_implementations/test_join.py test_join.py-20060302012326-9b5e9b0f0a03fedc
      bzrlib/tests/repository_implementations/test_reconcile.py test_reconcile.py-20060223022332-572ef70a3288e369
      bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/test_bugtracker.py test_bugtracker.py-20070410073305-vu1vu1qosjurg8kb-2
      bzrlib/tests/test_errors.py    test_errors.py-20060210110251-41aba2deddf936a8
      bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
      bzrlib/tests/test_lazy_import.py test_lazy_import.py-20060910203832-f77c54gf3n232za0-2
      bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
      bzrlib/tests/test_mail_client.py test_mail_client.py-20070809192806-vuxt3t19srtpjpdn-2
      bzrlib/tests/test_plugins.py   plugins.py-20050622075746-32002b55e5e943e9
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
      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_status.py    test_status.py-20060516190614-fbf6432e4a6e8aa5
      bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
      bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
      bzrlib/tests/test_wsgi.py      test_wsgi.py-20061005091552-rz8pva0olkxv0sd8-1
      bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
      bzrlib/transport/chroot.py     chroot.py-20061011104729-0us9mgm97z378vnt-1
      bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
      bzrlib/transport/http/wsgi.py  wsgi.py-20061005091552-rz8pva0olkxv0sd8-2
      bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
      bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
      bzrlib/weave.py                knit.py-20050627021749-759c29984154256b
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
      doc/developers/repository.txt  repository.txt-20070709152006-xkhlek456eclha4u-1
      doc/en/user-guide/annotating_changes.txt annotating_changes.t-20071122141511-0knao2lklsdsvb1q-1
      doc/en/user-guide/bazaar_workflows.txt bazaar_workflows.txt-20071114035000-q36a9h57ps06uvnl-1
      doc/en/user-guide/http_smart_server.txt fastcgi.txt-20061005091552-rz8pva0olkxv0sd8-3
      doc/en/user-guide/installing_bazaar.txt installing_bazaar.tx-20071114035000-q36a9h57ps06uvnl-4
      doc/en/user-guide/introducing_bazaar.txt introducing_bazaar.t-20071114035000-q36a9h57ps06uvnl-5
      bzrlib/tests/test_revisionspec.py testrevisionnamespaces.py-20050711050225-8b4af89e6b1efe84
    ------------------------------------------------------------
    revno: 3311.2.2
    revision-id:aaron at aaronbentley.com-20080406033414-bghccvp8kk2nt1av
    parent: aaron at aaronbentley.com-20080405173656-yfi7fhfhh0vwre5f
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.reconfigure3
    timestamp: Sat 2008-04-05 23:34:14 -0400
    message:
      Flesh out to_sharing
    modified:
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/reconfigure.py          reconfigure.py-20070908040425-6ykgo7escxhyrg9p-1
      bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
    ------------------------------------------------------------
    revno: 3311.2.1
    revision-id:aaron at aaronbentley.com-20080405173656-yfi7fhfhh0vwre5f
    parent: pqm at pqm.ubuntu.com-20080327163915-wtpepv5kq5hm42zv
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.reconfigure3
    timestamp: Sat 2008-04-05 13:36:56 -0400
    message:
      Initial make-sharing functionality
    modified:
      bzrlib/reconfigure.py          reconfigure.py-20070908040425-6ykgo7escxhyrg9p-1
      bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
=== modified file 'NEWS'
--- a/NEWS	2008-04-11 09:14:34 +0000
+++ b/NEWS	2008-04-12 06:46:35 +0000
@@ -50,6 +50,9 @@
       See the User Reference for signature details.
       (Ian Clatworthy, James Henstridge)
 
+    * Reconfigure can convert a branch to be standalone or to use a shared
+      repository.  (Aaron Bentley)
+
   IMPROVEMENTS:
 
     * The smart protocol now has support for setting branches' revision info

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2008-04-09 03:00:55 +0000
+++ b/bzrlib/builtins.py	2008-04-12 06:46:35 +0000
@@ -4436,7 +4436,9 @@
                      tree='Reconfigure to a tree.',
                      checkout='Reconfigure to a checkout.',
                      lightweight_checkout='Reconfigure to a lightweight'
-                     ' checkout.'),
+                     ' checkout.',
+                     standalone='Reconfigure to be standalone.',
+                     use_shared='Reconfigure to use a shared repository.'),
                      Option('bind-to', help='Branch to bind checkout to.',
                             type=str),
                      Option('force',
@@ -4458,6 +4460,10 @@
         elif target_type == 'lightweight-checkout':
             reconfiguration = reconfigure.Reconfigure.to_lightweight_checkout(
                 directory, bind_to)
+        elif target_type == 'use-shared':
+            reconfiguration = reconfigure.Reconfigure.to_use_shared(directory)
+        elif target_type == 'standalone':
+            reconfiguration = reconfigure.Reconfigure.to_standalone(directory)
         reconfiguration.apply(force)
 
 

=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py	2008-04-10 06:19:49 +0000
+++ b/bzrlib/errors.py	2008-04-12 06:46:35 +0000
@@ -2571,6 +2571,16 @@
     _fmt = "'%(display_url)s' is already a lightweight checkout."
 
 
+class AlreadyUsingShared(BzrDirError):
+
+    _fmt = "'%(display_url)s' is already using a shared repository."
+
+
+class AlreadyStandalone(BzrDirError):
+
+    _fmt = "'%(display_url)s' is already standalone."
+
+
 class ReconfigurationNotSupported(BzrDirError):
 
     _fmt = "Requested reconfiguration of '%(display_url)s' is not supported."

=== modified file 'bzrlib/reconfigure.py'
--- a/bzrlib/reconfigure.py	2008-01-18 03:33:47 +0000
+++ b/bzrlib/reconfigure.py	2008-04-12 05:48:07 +0000
@@ -18,6 +18,7 @@
 
 from bzrlib import (
     branch,
+    bzrdir,
     errors,
     )
 
@@ -30,6 +31,12 @@
             self.repository = self.bzrdir.find_repository()
         except errors.NoRepositoryPresent:
             self.repository = None
+        else:
+            if (self.repository.bzrdir.root_transport.base ==
+                self.bzrdir.root_transport.base):
+                self.local_repository = self.repository
+            else:
+                self.local_repository = None
         try:
             branch = self.bzrdir.open_branch()
             if branch.bzrdir.root_transport.base == bzrdir.root_transport.base:
@@ -115,6 +122,24 @@
             raise errors.AlreadyLightweightCheckout(bzrdir)
         return reconfiguration
 
+    @classmethod
+    def to_use_shared(klass, bzrdir):
+        """Convert a standalone branch into a repository branch"""
+        reconfiguration = klass(bzrdir)
+        reconfiguration._set_use_shared(use_shared=True)
+        if not reconfiguration.changes_planned():
+            raise errors.AlreadyUsingShared(bzrdir)
+        return reconfiguration
+
+    @classmethod
+    def to_standalone(klass, bzrdir):
+        """Convert a repository branch into a standalone branch"""
+        reconfiguration = klass(bzrdir)
+        reconfiguration._set_use_shared(use_shared=False)
+        if not reconfiguration.changes_planned():
+            raise errors.AlreadyStandalone(bzrdir)
+        return reconfiguration
+
     def _plan_changes(self, want_tree, want_branch, want_bound,
                       want_reference):
         """Determine which changes are needed to assume the configuration"""
@@ -155,12 +180,22 @@
         if want_tree and self.tree is None:
             self._create_tree = True
 
+    def _set_use_shared(self, use_shared=None):
+        if use_shared is None:
+            return
+        if use_shared:
+            if self.local_repository is not None:
+                self._destroy_repository = True
+        else:
+            if self.local_repository is None:
+                self._create_repository = True
+
     def changes_planned(self):
         """Return True if changes are planned, False otherwise"""
         return (self._unbind or self._bind or self._destroy_tree
                 or self._create_tree or self._destroy_reference
                 or self._create_branch or self._create_repository
-                or self._create_reference)
+                or self._create_reference or self._destroy_repository)
 
     def _check(self):
         """Raise if reconfiguration would destroy local changes"""
@@ -213,6 +248,9 @@
             self._check()
         if self._create_repository:
             repo = self.bzrdir.create_repository()
+            if self.local_branch and not self._destroy_branch:
+                repo.fetch(self.local_branch.repository,
+                           self.local_branch.last_revision())
         else:
             repo = self.repository
         if self._create_branch and self.referenced_branch is not None:
@@ -223,6 +261,11 @@
         if self._destroy_repository:
             if self._create_reference:
                 reference_branch.repository.fetch(self.repository)
+            elif self.local_branch is not None and not self._destroy_branch:
+                up = self.local_branch.bzrdir.root_transport.clone('..')
+                up_bzrdir = bzrdir.BzrDir.open_containing_from_transport(up)[0]
+                new_repo = up_bzrdir.find_repository()
+                new_repo.fetch(self.repository)
         last_revision_info = None
         if self._destroy_reference:
             last_revision_info = self.referenced_branch.last_revision_info()

=== modified file 'bzrlib/tests/blackbox/test_reconfigure.py'
--- a/bzrlib/tests/blackbox/test_reconfigure.py	2007-11-29 17:32:23 +0000
+++ b/bzrlib/tests/blackbox/test_reconfigure.py	2008-04-12 05:48:07 +0000
@@ -15,6 +15,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 from bzrlib import (
+    bzrdir,
     errors,
     tests,
     workingtree,
@@ -66,3 +67,22 @@
         branch = self.make_branch('branch')
         checkout = branch.create_checkout('checkout')
         self.run_bzr('reconfigure --lightweight-checkout checkout')
+
+    def test_standalone_to_use_shared(self):
+        self.build_tree(['repo/'])
+        tree = self.make_branch_and_tree('repo/tree')
+        repo = self.make_repository('repo', shared=True)
+        self.run_bzr('reconfigure --use-shared', working_dir='repo/tree')
+        tree = workingtree.WorkingTree.open('repo/tree')
+        self.assertNotEqual(tree.bzrdir.root_transport.base,
+            tree.branch.repository.bzrdir.root_transport.base)
+
+    def test_use_shared_to_standalone(self):
+        repo = self.make_repository('repo', shared=True)
+        branch = bzrdir.BzrDir.create_branch_convenience('repo/tree')
+        self.assertNotEqual(branch.bzrdir.root_transport.base,
+            branch.repository.bzrdir.root_transport.base)
+        self.run_bzr('reconfigure --standalone', working_dir='repo/tree')
+        tree = workingtree.WorkingTree.open('repo/tree')
+        self.assertEqual(tree.bzrdir.root_transport.base,
+            tree.branch.repository.bzrdir.root_transport.base)

=== modified file 'bzrlib/tests/test_reconfigure.py'
--- a/bzrlib/tests/test_reconfigure.py	2008-01-18 03:53:52 +0000
+++ b/bzrlib/tests/test_reconfigure.py	2008-04-12 06:37:15 +0000
@@ -286,3 +286,69 @@
         workingtree.WorkingTree.open('repo')
         self.assertRaises(errors.NoRepositoryPresent,
                           repository.Repository.open, 'repo')
+
+    def test_standalone_to_use_shared(self):
+        self.build_tree(['root/'])
+        tree = self.make_branch_and_tree('root/tree')
+        tree.commit('Hello', rev_id='hello-id')
+        repo = self.make_repository('root', shared=True)
+        reconfiguration = reconfigure.Reconfigure.to_use_shared(tree.bzrdir)
+        reconfiguration.apply()
+        tree = workingtree.WorkingTree.open('root/tree')
+        self.assertTrue(repo.has_same_location(tree.branch.repository))
+        self.assertEqual('Hello', repo.get_revision('hello-id').message)
+
+    def add_dead_head(self, tree):
+        revno, revision_id = tree.branch.last_revision_info()
+        tree.commit('Dead head', rev_id='dead-head-id')
+        tree.branch.set_last_revision_info(revno, revision_id)
+        tree.set_last_revision(revision_id)
+
+    def test_standalone_to_use_shared_preserves_dead_heads(self):
+        self.build_tree(['root/'])
+        tree = self.make_branch_and_tree('root/tree')
+        self.add_dead_head(tree)
+        tree.commit('Hello', rev_id='hello-id')
+        repo = self.make_repository('root', shared=True)
+        reconfiguration = reconfigure.Reconfigure.to_use_shared(tree.bzrdir)
+        reconfiguration.apply()
+        tree = workingtree.WorkingTree.open('root/tree')
+        message = repo.get_revision('dead-head-id').message
+        self.assertEqual('Dead head', message)
+
+    def make_repository_tree(self):
+        self.build_tree(['root/'])
+        repo = self.make_repository('root', shared=True)
+        tree = self.make_branch_and_tree('root/tree')
+        reconfigure.Reconfigure.to_use_shared(tree.bzrdir).apply()
+        return workingtree.WorkingTree.open('root/tree')
+
+    def test_use_shared_to_use_shared(self):
+        tree = self.make_repository_tree()
+        self.assertRaises(errors.AlreadyUsingShared,
+                          reconfigure.Reconfigure.to_use_shared, tree.bzrdir)
+
+    def test_use_shared_to_standalone(self):
+        tree = self.make_repository_tree()
+        tree.commit('Hello', rev_id='hello-id')
+        reconfigure.Reconfigure.to_standalone(tree.bzrdir).apply()
+        tree = workingtree.WorkingTree.open('root/tree')
+        repo = tree.branch.repository
+        self.assertEqual(repo.bzrdir.root_transport.base,
+                         tree.bzrdir.root_transport.base)
+        self.assertEqual('Hello', repo.get_revision('hello-id').message)
+
+    def test_use_shared_to_standalone_preserves_dead_heads(self):
+        tree = self.make_repository_tree()
+        self.add_dead_head(tree)
+        tree.commit('Hello', rev_id='hello-id')
+        reconfigure.Reconfigure.to_standalone(tree.bzrdir).apply()
+        tree = workingtree.WorkingTree.open('root/tree')
+        repo = tree.branch.repository
+        self.assertRaises(errors.NoSuchRevision, repo.get_revision,
+                          'dead-head-id')
+
+    def test_standalone_to_standalone(self):
+        tree = self.make_branch_and_tree('tree')
+        self.assertRaises(errors.AlreadyStandalone,
+                          reconfigure.Reconfigure.to_standalone, tree.bzrdir)




More information about the bazaar-commits mailing list