Rev 4266: (abentley) show join, hide --reference option. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Apr 7 19:03:39 BST 2009


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

------------------------------------------------------------
revno: 4266
revision-id: pqm at pqm.ubuntu.com-20090407180335-g11gve6533bv8lei
parent: pqm at pqm.ubuntu.com-20090407135643-r15qstzbwg87d2nq
parent: aaron at aaronbentley.com-20090407171351-m5l8kej7qlt7dc3k
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-04-07 19:03:35 +0100
message:
  (abentley) show join, hide --reference option.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/option.py               option.py-20051014052914-661fb36e76e7362f
  bzrlib/tests/test_commands.py  test_command.py-20051019190109-3b17be0f52eaa7a8
  bzrlib/tests/test_options.py   testoptions.py-20051014093702-96457cfc86319a8f
    ------------------------------------------------------------
    revno: 4251.1.7
    revision-id: aaron at aaronbentley.com-20090407171351-m5l8kej7qlt7dc3k
    parent: aaron at aaronbentley.com-20090407144924-s98zo48wnqv99pht
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: hide-reference
    timestamp: Tue 2009-04-07 13:13:51 -0400
    message:
      Use generated subclass instead of patching Command instance
    modified:
      bzrlib/tests/test_commands.py  test_command.py-20051019190109-3b17be0f52eaa7a8
    ------------------------------------------------------------
    revno: 4251.1.6
    revision-id: aaron at aaronbentley.com-20090407144924-s98zo48wnqv99pht
    parent: aaron at aaronbentley.com-20090404020819-lemzu7gz8madz9xd
    parent: pqm at pqm.ubuntu.com-20090407135643-r15qstzbwg87d2nq
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: hide-reference
    timestamp: Tue 2009-04-07 10:49:24 -0400
    message:
      Merge bzr.dev into hide-reference.
    added:
      bzrlib/_chk_map_py.py          _chk_map_py.py-20090309114220-1kurz7oez2gwqtcf-1
      bzrlib/_chk_map_pyx.pyx        _chk_map_pyx.pyx-20090309111231-peyz7p2azr0dzdrb-1
      bzrlib/_groupcompress_py.py    _groupcompress_py.py-20090324110021-j63s399f4icrgw4p-1
      bzrlib/_groupcompress_pyx.pyx  _groupcompress_c.pyx-20080724041824-yelg6ii7c7zxt4z0-1
      bzrlib/chk_map.py              chk_map.py-20081001014447-ue6kkuhofvdecvxa-1
      bzrlib/chk_serializer.py       chk_serializer.py-20081002064345-2tofdfj2eqq01h4b-1
      bzrlib/delta.h                 delta.h-20090227173129-qsu3u43vowf1q3ay-1
      bzrlib/diff-delta.c            diffdelta.c-20090226042143-l9wzxynyuxnb5hus-1
      bzrlib/groupcompress.py        groupcompress.py-20080705181503-ccbxd6xuy1bdnrpu-8
      bzrlib/repofmt/groupcompress_repo.py repofmt.py-20080715094215-wp1qfvoo7093c8qr-1
      bzrlib/tests/per_repository_chk/ per_repository_chk-20080925061730-e4g24t5xstp2n2vp-1
      bzrlib/tests/per_repository_chk/__init__.py __init__.py-20080925061730-e4g24t5xstp2n2vp-2
      bzrlib/tests/per_repository_chk/test_supported.py test_supported.py-20080925063728-k65ry0n2rhta6t34-1
      bzrlib/tests/per_repository_chk/test_unsupported.py test_unsupported.py-20080925063728-k65ry0n2rhta6t34-2
      bzrlib/tests/test__chk_map.py  test__chk_map.py-20090309114220-1kurz7oez2gwqtcf-2
      bzrlib/tests/test__groupcompress.py test__groupcompress_-20080724145854-koifwb7749cfzrvj-1
      bzrlib/tests/test_chk_map.py   test_chk_map.py-20081001014447-ue6kkuhofvdecvxa-2
      bzrlib/tests/test_groupcompress.py test_groupcompress.p-20080705181503-ccbxd6xuy1bdnrpu-13
    modified:
      .bzrignore                     bzrignore-20050311232317-81f7b71efa2db11a
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/add.py                  add.py-20050323030017-3a77d63feda58e33
      bzrlib/annotate.py             annotate.py-20050922133147-7c60541d2614f022
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/btree_index.py          index.py-20080624222253-p0x5f92uyh5hw734-7
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
      bzrlib/filters/__init__.py     __init__.py-20080416080515-mkxl29amuwrf6uir-2
      bzrlib/filters/eol.py          eol.py-20090327060429-todzdjmqt3bpv5r8-1
      bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
      bzrlib/hooks.py                hooks.py-20070325015548-ix4np2q0kd8452au-1
      bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
      bzrlib/merge.py                merge.py-20050513021216-953b65a438527106
      bzrlib/multiparent.py          __init__.py-20070410133617-n1jdhcc1n1mibarp-1
      bzrlib/pack.py                 container.py-20070607160755-tr8zc26q18rn0jnb-1
      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/revision.py             revision.py-20050309040759-e77802c08f3999d5
      bzrlib/revisiontree.py         revisiontree.py-20060724012533-bg8xyryhxd0o0i0h-1
      bzrlib/smart/bzrdir.py         bzrdir.py-20061122024551-ol0l0o0oofsu9b3t-1
      bzrlib/smart/medium.py         medium.py-20061103051856-rgu2huy59fkz902q-1
      bzrlib/smart/server.py         server.py-20061110062051-chzu10y32vx8gvur-1
      bzrlib/symbol_versioning.py    symbol_versioning.py-20060105104851-9ecf8af605d15a80
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/test_add.py test_add.py-20060518072250-857e4f86f54a30b2
      bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
      bzrlib/tests/blackbox/test_filtered_view_ops.py test_filtered_view_o-20081110012645-5t7ogtola0l33lkg-1
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
      bzrlib/tests/blackbox/test_uncommit.py test_uncommit.py-20051027212835-84944b63adae51be
      bzrlib/tests/blackbox/test_view.py test_view.py-20080731135100-66o8o32heop7augi-1
      bzrlib/tests/branch_implementations/test_break_lock.py test_break_lock.py-20060504111902-9aae411dbe9aadd2
      bzrlib/tests/intertree_implementations/__init__.py __init__.py-20060724101752-09ysswo1a92uqyoz-3
      bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
      bzrlib/tests/inventory_implementations/basics.py basics.py-20070903044446-kdjwbiu1p1zi9phs-1
      bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
      bzrlib/tests/test_filters.py   test_filters.py-20080417120614-tc3zok0vvvprsc99-1
      bzrlib/tests/test_hooks.py     test_hooks.py-20070628030849-89rtsbe5dmer5npz-1
      bzrlib/tests/test_http.py      testhttp.py-20051018020158-b2eef6e867c514d9
      bzrlib/tests/test_inv.py       testinv.py-20050722220913-1dc326138d1a5892
      bzrlib/tests/test_lockable_files.py test_lockable_files.py-20051225183927-365c7fd99591caf1
      bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
      bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
      bzrlib/tests/test_ui.py        test_ui.py-20051130162854-458e667a7414af09
      bzrlib/tests/test_version_info.py test_version_info.py-20051228204928-2c364e30b702b41b
      bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
      bzrlib/tests/workingtree_implementations/test_read_working_inventory.py test_read_working_in-20061005073432-585uyj0sua6r7i9v-2
      bzrlib/ui/__init__.py          ui.py-20050824083933-8cf663c763ba53a9
      bzrlib/version_info_formats/format_rio.py format_rio.py-20060809202444-ike7i9ub03gb432p-2
      bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
      bzrlib/win32utils.py           win32console.py-20051021033308-123c6c929d04973d
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
      bzrlib/xml5.py                 xml5.py-20080328030717-t9guwinq8hom0ar3-1
      bzrlib/xml8.py                 xml5.py-20050907032657-aac8f960815b66b1
      doc/developers/container-format.txt containerformat.txt-20070601074309-7n7w1jiyayud6xdn-1
      doc/developers/development-repo.txt developmentrepo.txt-20080102200205-raj42k61dch8pjmj-1
      doc/developers/incremental-push-pull.txt incrementalpushpull.-20070508045640-zneiu1yzbci574c6-1
      doc/developers/inventory.txt   inventory.txt-20080103013957-opkrhxy6lmywmx4i-1
      doc/developers/lca-merge.txt   lcamerge.txt-20080103061803-9isydn4ivgwrvorw-1
      doc/developers/merge-scaling.txt mergescaling.rst-20070527173558-rqaqxn1al7vzgcto-2
      doc/developers/network-protocol.txt networkprotocol.txt-20070903044232-woustorrjbmg5zol-1
      doc/developers/planned-performance-changes.txt plannedperformancech-20070604053752-bnjdhako613xfufb-1
      doc/en/user-guide/releasing_a_project.txt releasing_a_project.-20071121073725-0corxykv5irjal00-5
      doc/en/user-guide/server.txt   server.txt-20060913044801-h939fvbwzz39gf7g-1
      doc/en/user-guide/specifying_revisions.txt specifying_revisions.txt-20060314161707-19deb139101bea33
      setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
    ------------------------------------------------------------
    revno: 4251.1.5
    revision-id: aaron at aaronbentley.com-20090404020819-lemzu7gz8madz9xd
    parent: aaron at aaronbentley.com-20090404005105-oix5bjvtyi5khuym
    parent: pqm at pqm.ubuntu.com-20090404000810-fqvkqdjx9s1h9ks3
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: hide-reference
    timestamp: Fri 2009-04-03 22:08:19 -0400
    message:
      Merge bzr.dev into hide-reference
    added:
      bzrlib/serializer.py           serializer.py-20090402143702-wmkh9cfjhwpju0qi-1
      bzrlib/tests/test_serializer.py test_serializer.py-20090403213933-q6x117y8t9fbeyoz-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/bundle/serializer/v4.py v10.py-20070611062757-5ggj7k18s9dej0fr-1
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/test_version_info.py test_version_info.py-20051228204928-2c364e30b702b41b
      bzrlib/tests/test_xml.py       test_xml.py-20050905091053-80b45588931a9b35
      bzrlib/version_info_formats/format_custom.py format_custom.py-20071029100350-ajovqhbpb5khf6gu-1
      bzrlib/version_info_formats/format_python.py format_python.py-20060809202444-ike7i9ub03gb432p-1
      bzrlib/version_info_formats/format_rio.py format_rio.py-20060809202444-ike7i9ub03gb432p-2
      bzrlib/xml4.py                 xml4.py-20050916091259-db5ab55e7e6ca324
      bzrlib/xml8.py                 xml5.py-20050907032657-aac8f960815b66b1
      bzrlib/xml_serializer.py       xml.py-20050309040759-57d51586fdec365d
    ------------------------------------------------------------
    revno: 4251.1.4
    revision-id: aaron at aaronbentley.com-20090404005105-oix5bjvtyi5khuym
    parent: aaron at aaronbentley.com-20090403211020-htcyo3m6mblv6607
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: hide-reference
    timestamp: Fri 2009-04-03 20:51:05 -0400
    message:
      Uncomment split's 'See also:join'
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
    ------------------------------------------------------------
    revno: 4251.1.3
    revision-id: aaron at aaronbentley.com-20090403211020-htcyo3m6mblv6607
    parent: aaron at aaronbentley.com-20090403200828-mghj50gw3rm22et2
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: hide-reference
    timestamp: Fri 2009-04-03 17:10:20 -0400
    message:
      Reveal join command.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
    ------------------------------------------------------------
    revno: 4251.1.2
    revision-id: aaron at aaronbentley.com-20090403200828-mghj50gw3rm22et2
    parent: aaron at aaronbentley.com-20090403200525-5vcdyhnjrlsqd6dr
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: hide-reference
    timestamp: Fri 2009-04-03 16:08:28 -0400
    message:
      Hide the --reference option.
    modified:
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
    ------------------------------------------------------------
    revno: 4251.1.1
    revision-id: aaron at aaronbentley.com-20090403200525-5vcdyhnjrlsqd6dr
    parent: pqm at pqm.ubuntu.com-20090403190338-yy0lftj7t2v9vah3
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: hide-reference
    timestamp: Fri 2009-04-03 16:05:25 -0400
    message:
      Support hidden options.
    modified:
      bzrlib/option.py               option.py-20051014052914-661fb36e76e7362f
      bzrlib/tests/test_commands.py  test_command.py-20051019190109-3b17be0f52eaa7a8
      bzrlib/tests/test_options.py   testoptions.py-20051014093702-96457cfc86319a8f
=== modified file 'NEWS'
--- a/NEWS	2009-04-07 13:56:43 +0000
+++ b/NEWS	2009-04-07 14:49:24 +0000
@@ -72,6 +72,9 @@
   content filtering. See ``bzr help eol`` for details.
   (Ian Clatworthy)
 
+* Newly-blessed `join` command allows combining two trees into one.
+  (Aaron Bentley)
+
 Improvements
 ************
 
@@ -141,7 +144,9 @@
 * bzr gives a better message if an invalid regexp is passed to ``bzr log
   -m``.  (Anne Mohsen, Martin Pool)
 
-* ``bzr version-info`` now works in empty branches. (Jelmer Vernooij, 
+* ``bzr split`` now says "See also: join" (Aaron Bentley, #335015)
+
+* ``bzr version-info`` now works in empty branches. (Jelmer Vernooij,
   #313028)
 
 * Fix "is not a stackable format" error when pushing a

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2009-04-04 02:50:01 +0000
+++ b/bzrlib/builtins.py	2009-04-07 14:49:24 +0000
@@ -4583,11 +4583,9 @@
 
 
 class cmd_join(Command):
-    """Combine a subtree into its containing tree.
+    """Combine a tree into its containing 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 requires the target tree to be in a rich-root format.
 
     The TREE argument should be an independent tree, inside another tree, but
     not part of it.  (Such trees can be produced by "bzr split", but also by
@@ -4596,19 +4594,13 @@
     The result is a combined tree, with the subtree no longer an independant
     part.  This is marked as a merge of the subtree into the containing tree,
     and all history is preserved.
-
-    If --reference is specified, the subtree retains its independence.  It can
-    be branched by itself, and can be part of multiple projects at the same
-    time.  But operations performed in the containing tree, such as commit
-    and merge, will recurse into the subtree.
     """
 
     _see_also = ['split']
     takes_args = ['tree']
     takes_options = [
-            Option('reference', help='Join by reference.'),
+            Option('reference', help='Join by reference.', hidden=True),
             ]
-    hidden = True
 
     def run(self, tree, reference=False):
         sub_tree = WorkingTree.open(tree)
@@ -4648,8 +4640,7 @@
     branch.  Commits in the top-level tree will not apply to the new subtree.
     """
 
-    # join is not un-hidden yet
-    #_see_also = ['join']
+    _see_also = ['join']
     takes_args = ['tree']
 
     def run(self, tree):

=== modified file 'bzrlib/option.py'
--- a/bzrlib/option.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/option.py	2009-04-03 20:05:25 +0000
@@ -150,7 +150,8 @@
     OPTIONS = {}
 
     def __init__(self, name, help='', type=None, argname=None,
-                 short_name=None, param_name=None, custom_callback=None):
+                 short_name=None, param_name=None, custom_callback=None,
+                 hidden=False):
         """Make a new command option.
 
         :param name: regular name of the command, used in the double-dash
@@ -173,6 +174,8 @@
         :param custom_callback: a callback routine to be called after normal
             processing. The signature of the callback routine is
             (option, name, new_value, parser).
+        :param hidden: If True, the option should be hidden in help and
+            documentation.
         """
         self.name = name
         self.help = help
@@ -189,6 +192,7 @@
         else:
             self._param_name = param_name
         self.custom_callback = custom_callback
+        self.hidden = hidden
 
     def short_name(self):
         if self._short_name:
@@ -208,12 +212,16 @@
         option_strings = ['--%s' % self.name]
         if short_name is not None:
             option_strings.append('-%s' % short_name)
+        if self.hidden:
+            help = optparse.SUPPRESS_HELP
+        else:
+            help = self.help
         optargfn = self.type
         if optargfn is None:
             parser.add_option(action='callback',
                               callback=self._optparse_bool_callback,
                               callback_args=(True,),
-                              help=self.help,
+                              help=help,
                               *option_strings)
             negation_strings = ['--%s' % self.get_negation_name()]
             parser.add_option(action='callback',
@@ -224,7 +232,7 @@
             parser.add_option(action='callback',
                               callback=self._optparse_callback,
                               type='string', metavar=self.argname.upper(),
-                              help=self.help,
+                              help=help,
                               default=OptionParser.DEFAULT_VALUE,
                               *option_strings)
 
@@ -250,7 +258,7 @@
         yield self.name, self.short_name(), argname, self.help
 
     def is_hidden(self, name):
-        return False
+        return self.hidden
 
 
 class ListOption(Option):

=== modified file 'bzrlib/tests/test_commands.py'
--- a/bzrlib/tests/test_commands.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/test_commands.py	2009-04-07 17:13:51 +0000
@@ -23,6 +23,7 @@
     commands,
     config,
     errors,
+    option,
     tests,
     )
 from bzrlib.commands import display_command
@@ -60,6 +61,23 @@
         self.assertRaises(errors.BzrCommandError,
                           commands.run_bzr, ['log', u'--option\xb5'])
 
+    @staticmethod
+    def get_command(options):
+        class cmd_foo(commands.Command):
+            'Bar'
+
+            takes_options = options
+
+        return cmd_foo()
+
+    def test_help_hidden(self):
+        c = self.get_command([option.Option('foo', hidden=True)])
+        self.assertNotContainsRe(c.get_help_text(), '--foo')
+
+    def test_help_not_hidden(self):
+        c = self.get_command([option.Option('foo', hidden=False)])
+        self.assertContainsRe(c.get_help_text(), '--foo')
+
 
 class TestGetAlias(tests.TestCase):
 

=== modified file 'bzrlib/tests/test_options.py'
--- a/bzrlib/tests/test_options.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/test_options.py	2009-04-03 20:05:25 +0000
@@ -102,6 +102,10 @@
         self.assertRaises(errors.BzrCommandError, self.parse, options,
                           ['--no-number'])
 
+    def test_is_hidden(self):
+        self.assertTrue(option.Option('foo', hidden=True).is_hidden('foo'))
+        self.assertFalse(option.Option('foo', hidden=False).is_hidden('foo'))
+
     def test_registry_conversion(self):
         registry = bzrdir.BzrDirFormatRegistry()
         registry.register_metadir('one', 'RepositoryFormat7', 'one help')




More information about the bazaar-commits mailing list