Rev 3128: Un-hide split command (abentley) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Dec 19 07:02:04 GMT 2007


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

------------------------------------------------------------
revno: 3128
revision-id:pqm at pqm.ubuntu.com-20071219070154-6d8alx13vc5ur6hs
parent: pqm at pqm.ubuntu.com-20071219033918-4r7sd1wllfw5oyf2
parent: aaron.bentley at utoronto.ca-20071219060419-afwva4q14cjlzfta
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-12-19 07:01:54 +0000
message:
  Un-hide split command (abentley)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_split.py test_split.py-20061008023421-qy0vdpzysh5rriu8-1
  bzrlib/tests/test_extract.py   test_extract.py-20061002214140-qdnnm67q1ov6x6pd-1
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
    ------------------------------------------------------------
    revno: 3113.6.6
    revision-id:aaron.bentley at utoronto.ca-20071219060419-afwva4q14cjlzfta
    parent: abentley at panoramicfeedback.com-20071217192735-h4gok4fpvl6ppis0
    parent: pqm at pqm.ubuntu.com-20071219033918-4r7sd1wllfw5oyf2
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: bzr.ab2
    timestamp: Wed 2007-12-19 01:04:19 -0500
    message:
      Merge with bzr.dev
    added:
      bzrlib/help_topics/            help_topics-20071211013603-qz0sojhgxhiujm6a-1
      bzrlib/help_topics/en/         bzrlibhelp-20071209214431-xzg3moksichjwyts-1
      bzrlib/version_info_formats/format_custom.py format_custom.py-20071029100350-ajovqhbpb5khf6gu-1
      doc/en/user-reference/readme.txt readme.txt-20071211133352-guencaey6fpesv4j-1
    renamed:
      bzrlib/help_topics.py => bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      doc/en/user-guide/authentication_conf.txt => bzrlib/help_topics/en/authentication.txt authentication_conf.-20071104135035-glfv0ri355tyg1nf-1
      doc/en/user-guide/configuration.txt => bzrlib/help_topics/en/configuration.txt configuration.txt-20060314161707-868350809502af01
      doc/en/user-guide/conflicts.txt => bzrlib/help_topics/en/conflicts.txt conflicts.txt-20070723221841-ns3jvwxdb4okn6fk-1
      doc/en/user-reference/hooks.txt => bzrlib/help_topics/en/hooks.txt hooks.txt-20070830033044-xxu2rced13f72dka-1
    modified:
      .bzrignore                     bzrignore-20050311232317-81f7b71efa2db11a
      Makefile                       Makefile-20050805140406-d96e3498bb61c5bb
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      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/cmd_version_info.py     __init__.py-20051228204928-697d01fdca29c99b
      bzrlib/diff.py                 diff.py-20050309040759-26944fbbf2ebbf36
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
      bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
      bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
      bzrlib/lockable_files.py       control_files.py-20051111201905-bb88546e799d669f
      bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
      bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/revision.py             revision.py-20050309040759-e77802c08f3999d5
      bzrlib/smart/medium.py         medium.py-20061103051856-rgu2huy59fkz902q-1
      bzrlib/symbol_versioning.py    symbol_versioning.py-20060105104851-9ecf8af605d15a80
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      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_non_ascii.py test_non_ascii.py-20060105214030-68010be784a5d854
      bzrlib/tests/blackbox/test_outside_wt.py test_outside_wt.py-20060116200058-98edd33e7db8bdde
      bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/test_ancestry.py  test_ancestry.py-20050913023709-69768e94848312c6
      bzrlib/tests/test_graph.py     test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
      bzrlib/tests/test_help.py      test_help.py-20070419045354-6q6rq15j9e2n5fna-1
      bzrlib/tests/test_lockable_files.py test_lockable_files.py-20051225183927-365c7fd99591caf1
      bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
      bzrlib/tests/test_revision.py  testrevision.py-20050804210559-46f5e1eb67b01289
      bzrlib/tests/test_version_info.py test_version_info.py-20051228204928-2c364e30b702b41b
      bzrlib/tests/tree_implementations/test_inv.py test_inv.py-20070312023226-0cdvk5uwhutis9vg-1
      bzrlib/version_info_formats/__init__.py generate_version_info.py-20051228204928-8358edabcddcd97e
      doc/en/user-guide/browsing_history.txt browsing_history.txt-20071121073725-0corxykv5irjal00-2
      doc/en/user-guide/configuring_bazaar.txt configuring_bazaar.t-20071128000722-ncxiua259xwbdbg7-1
      doc/en/user-guide/hooks.txt    hooks.txt-20070829200551-7nr6e5a1io6x78uf-1
      doc/en/user-guide/index.txt    index.txt-20060622101119-tgwtdci8z769bjb9-2
      doc/en/user-guide/introducing_bazaar.txt introducing_bazaar.t-20071114035000-q36a9h57ps06uvnl-5
      doc/en/user-guide/sending_changes.txt sending_changes.txt-20071123154453-dk2mjhrg1vpjm5w2-4
      doc/en/user-guide/setting_up_email.txt setting_up_email.txt-20060314161707-fd242c8944346173
      doc/en/user-guide/version_info.txt version_info.txt-20060921215543-gju6o5xdic8w25np-1
      setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
      tools/doc_generate/autodoc_rstx.py autodoc_rstx.py-20060420024836-3e0d4a526452193c
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/help_topics/en/authentication.txt authentication_conf.-20071104135035-glfv0ri355tyg1nf-1
      bzrlib/help_topics/en/configuration.txt configuration.txt-20060314161707-868350809502af01
      bzrlib/help_topics/en/conflicts.txt conflicts.txt-20070723221841-ns3jvwxdb4okn6fk-1
      bzrlib/help_topics/en/hooks.txt hooks.txt-20070830033044-xxu2rced13f72dka-1
    ------------------------------------------------------------
    revno: 3113.6.5
    revision-id:abentley at panoramicfeedback.com-20071217192735-h4gok4fpvl6ppis0
    parent: abentley at panoramicfeedback.com-20071217192120-tpicwyj0qvvrjugp
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: bzr.ab2
    timestamp: Mon 2007-12-17 14:27:35 -0500
    message:
      Update tests
    modified:
      bzrlib/tests/blackbox/test_split.py test_split.py-20061008023421-qy0vdpzysh5rriu8-1
      bzrlib/tests/test_extract.py   test_extract.py-20061002214140-qdnnm67q1ov6x6pd-1
    ------------------------------------------------------------
    revno: 3113.6.4
    revision-id:abentley at panoramicfeedback.com-20071217192120-tpicwyj0qvvrjugp
    parent: abentley at panoramicfeedback.com-20071217150333-yp6qr05k721xke8d
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: bzr.ab2
    timestamp: Mon 2007-12-17 14:21:20 -0500
    message:
      Require the user to upgrade if they run split in a non-rich-root tree.
    modified:
      bzrlib/tests/blackbox/test_split.py test_split.py-20061008023421-qy0vdpzysh5rriu8-1
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
    ------------------------------------------------------------
    revno: 3113.6.3
    revision-id:abentley at panoramicfeedback.com-20071217150333-yp6qr05k721xke8d
    parent: abentley at panoramicfeedback.com-20071217145855-bmkr4roqbajk4jiw
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: bzr.ab2
    timestamp: Mon 2007-12-17 10:03:33 -0500
    message:
      Take credit
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3113.6.2
    revision-id:abentley at panoramicfeedback.com-20071217145855-bmkr4roqbajk4jiw
    parent: aaron.bentley at utoronto.ca-20071217144115-e08qrqvafagi7bdu
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: bzr.ab2
    timestamp: Mon 2007-12-17 09:58:55 -0500
    message:
      Un-hide split command, add NEWS
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
    ------------------------------------------------------------
    revno: 3113.6.1
    revision-id:aaron.bentley at utoronto.ca-20071217144115-e08qrqvafagi7bdu
    parent: pqm at pqm.ubuntu.com-20071214163914-dqiqxlhho36ce54r
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: bzr.ab2
    timestamp: Mon 2007-12-17 09:41:15 -0500
    message:
      Use source format where available for splitting
    modified:
      bzrlib/tests/blackbox/test_split.py test_split.py-20061008023421-qy0vdpzysh5rriu8-1
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
=== modified file 'NEWS'
--- a/NEWS	2007-12-19 02:44:29 +0000
+++ b/NEWS	2007-12-19 06:04:19 +0000
@@ -38,6 +38,9 @@
 
    * ``-l`` is now a short form for ``--limit`` in ``log``.  (Matt Nordhoff)
 
+   * ``split`` now supported, to enable splitting large trees into smaller
+     pieces.  (Aaron Bentley)
+
   BUGFIXES:
 
    * Fixed Unicode encoding error in ``ignored`` when the output is

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2007-12-18 15:23:12 +0000
+++ b/bzrlib/builtins.py	2007-12-19 06:04:19 +0000
@@ -3804,23 +3804,21 @@
 
 
 class cmd_split(Command):
-    """Split a tree into two trees.
+    """Split a subdirectory of a tree into a separate tree.
 
-    This command is for experimental use only.  It requires the target tree
-    to be in dirstate-with-subtree format, which cannot be converted into
-    earlier formats.
+    This command will produce a target tree in a format that supports
+    rich roots, like 'rich-root' or 'rich-root-pack'.  These formats cannot be
+    converted into earlier formats like 'dirstate-tags'.
 
     The TREE argument should be a subdirectory of a working tree.  That
     subdirectory will be converted into an independent tree, with its own
     branch.  Commits in the top-level tree will not apply to the new subtree.
-    If you want that behavior, do "bzr join --reference TREE".
     """
 
-    _see_also = ['join']
+    # join is not un-hidden yet
+    #_see_also = ['join']
     takes_args = ['tree']
 
-    hidden = True
-
     def run(self, tree):
         containing_tree, subdir = WorkingTree.open_containing(tree)
         sub_id = containing_tree.path2id(subdir)
@@ -3832,7 +3830,6 @@
             raise errors.UpgradeRequired(containing_tree.branch.base)
 
 
-
 class cmd_merge_directive(Command):
     """Generate a merge directive for auto-merge tools.
 

=== modified file 'bzrlib/tests/blackbox/test_split.py'
--- a/bzrlib/tests/blackbox/test_split.py	2007-06-26 20:32:49 +0000
+++ b/bzrlib/tests/blackbox/test_split.py	2007-12-17 19:27:35 +0000
@@ -17,14 +17,17 @@
 
 import os
 
-from bzrlib import bzrdir, tests
+from bzrlib import bzrdir, tests, workingtree
+from bzrlib.repofmt.knitrepo import RepositoryFormatKnit4
+from bzrlib.repofmt.pack_repo import RepositoryFormatKnitPack4
+
 
 
 class TestSplit(tests.TestCaseWithTransport):
 
     def test_split(self):
         self.build_tree(['a/', 'a/b/', 'a/b/c'])
-        wt = self.make_branch_and_tree('a')
+        wt = self.make_branch_and_tree('a', format='rich-root-pack')
         wt.add(['b', 'b/c'])
         wt.commit('rev1')
         self.run_bzr('split a/b')
@@ -38,3 +41,26 @@
         wt.add(['b', 'b/c', 'b/c/d'], ['b-id', 'c-id', 'd-id'])
         wt.commit('added files')
         self.run_bzr_error(('must upgrade your branch at .*a',), 'split a/b')
+
+    def test_split_tree_failure(self):
+        tree = self.make_branch_and_tree('tree', format='pack-0.92')
+        self.build_tree(['tree/subtree/'])
+        tree.add('subtree')
+        tree.commit('added subtree')
+        self.run_bzr_error(('must upgrade your branch at .*tree',),
+                           'split tree/subtree')
+
+    def split_formats(self, format, repo_format):
+        tree = self.make_branch_and_tree('rich-root', format=format)
+        self.build_tree(['rich-root/a/'])
+        tree.add('a')
+        self.run_bzr(['split', 'rich-root/a'])
+        subtree = workingtree.WorkingTree.open('rich-root/a')
+        self.assertIsInstance(subtree.branch.repository._format,
+                              repo_format)
+
+    def test_split_rich_root(self):
+        self.split_formats('rich-root', RepositoryFormatKnit4)
+
+    def test_split_rich_root_pack(self):
+        self.split_formats('rich-root-pack', RepositoryFormatKnitPack4)

=== modified file 'bzrlib/tests/test_extract.py'
--- a/bzrlib/tests/test_extract.py	2007-03-06 00:28:36 +0000
+++ b/bzrlib/tests/test_extract.py	2007-12-17 19:27:35 +0000
@@ -26,7 +26,7 @@
     
     def test_extract(self):
         self.build_tree(['a/', 'a/b/', 'a/b/c', 'a/d'])
-        wt = self.make_branch_and_tree('a')
+        wt = self.make_branch_and_tree('a', format='rich-root-pack')
         wt.add(['b', 'b/c', 'd'], ['b-id', 'c-id', 'd-id'])
         wt.commit('added files')
         b_wt = wt.extract('b-id')
@@ -47,14 +47,14 @@
         return wt.extract('b-id')
 
     def test_extract_in_checkout(self):
-        a_branch = self.make_branch('branch')
+        a_branch = self.make_branch('branch', format='rich-root-pack')
         self.extract_in_checkout(a_branch)
         b_branch = branch.Branch.open('branch/b')
         b_branch_ref = branch.Branch.open('a/b')
         self.assertEqual(b_branch.base, b_branch_ref.base)
 
     def test_extract_in_deep_checkout(self):
-        a_branch = self.make_branch('branch')
+        a_branch = self.make_branch('branch', format='rich-root-pack')
         self.build_tree(['a/', 'a/b/', 'a/b/c/', 'a/b/c/d/', 'a/b/c/d/e'])
         wt = a_branch.create_checkout('a', lightweight=True)
         wt.add(['b', 'b/c', 'b/c/d', 'b/c/d/e/'], ['b-id', 'c-id', 'd-id',

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2007-11-29 18:06:55 +0000
+++ b/bzrlib/workingtree.py	2007-12-17 19:21:20 +0000
@@ -1023,17 +1023,15 @@
         sub_path = self.id2path(file_id)
         branch_transport = mkdirs(sub_path)
         if format is None:
-            format = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
+            format = self.bzrdir.cloning_metadir()
         branch_transport.ensure_base()
         branch_bzrdir = format.initialize_on_transport(branch_transport)
         try:
             repo = branch_bzrdir.find_repository()
         except errors.NoRepositoryPresent:
             repo = branch_bzrdir.create_repository()
-            assert repo.supports_rich_root()
-        else:
-            if not repo.supports_rich_root():
-                raise errors.RootNotRich()
+        if not repo.supports_rich_root():
+            raise errors.RootNotRich()
         new_branch = branch_bzrdir.create_branch()
         new_branch.pull(self.branch)
         for parent_id in self.get_parent_ids():




More information about the bazaar-commits mailing list