Rev 3275: (Jelmer) Support child_submit_to option in submit-branch. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Mar 14 01:19:39 GMT 2008


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

------------------------------------------------------------
revno: 3275
revision-id:pqm at pqm.ubuntu.com-20080314011927-hi5bdap69742g7zn
parent: pqm at pqm.ubuntu.com-20080313234511-fkj5oa8gm3nrfcro
parent: jelmer at samba.org-20080306053216-b9kc2dbg4b93ve06
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-03-14 01:19:27 +0000
message:
  (Jelmer) Support child_submit_to option in submit-branch.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_send.py test_bundle.py-20060616222707-c21c8b7ea5ef57b1
    ------------------------------------------------------------
    revno: 3251.1.3
    revision-id:jelmer at samba.org-20080306053216-b9kc2dbg4b93ve06
    parent: jelmer at samba.org-20080306052823-3c9diwh1l8ef5dj0
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: child_submit
    timestamp: Thu 2008-03-06 06:32:16 +0100
    message:
      Fix formatting.
    modified:
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
    ------------------------------------------------------------
    revno: 3251.1.2
    revision-id:jelmer at samba.org-20080306052823-3c9diwh1l8ef5dj0
    parent: jelmer at samba.org-20080305223658-a9ici3oxtwyy0v11
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: child_submit
    timestamp: Thu 2008-03-06 06:28:23 +0100
    message:
      ``bzr send`` now supports new ``child_submit_to`` option in the submit branch 
      when determining the email address to send to.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/tests/blackbox/test_send.py test_bundle.py-20060616222707-c21c8b7ea5ef57b1
=== modified file 'NEWS'
--- a/NEWS	2008-03-13 18:51:13 +0000
+++ b/NEWS	2008-03-14 01:19:27 +0000
@@ -36,6 +36,10 @@
    * ``branch`` and ``checkout`` can hard-link working tree files, which is
      faster and saves space.  (Aaron Bentley)
 
+   * ``bzr send`` will now also look at the ``child_submit_to`` setting in
+     the submit branch to determine the email address to send to. 
+     (Jelmer Vernooij)
+
   IMPROVEMENTS:
 
    * BzrBranch._lefthand_history is faster on pack repos.  (Aaron Bentley)

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2008-03-12 23:08:34 +0000
+++ b/bzrlib/builtins.py	2008-03-14 01:19:27 +0000
@@ -4040,8 +4040,9 @@
     generic options are "default", "editor", "mapi", and "xdg-email".
 
     If mail is being sent, a to address is required.  This can be supplied
-    either on the commandline, or by setting the submit_to configuration
-    option.
+    either on the commandline, by setting the submit_to configuration
+    option in the branch itself or the child_submit_to configuration option 
+    in the submit branch.
 
     Two formats are currently supported: "4" uses revision bundle format 4 and
     merge directive format 2.  It is significantly faster and smaller than
@@ -4126,6 +4127,10 @@
             if remembered_submit_branch:
                 note('Using saved location: %s', submit_branch)
 
+            if mail_to is None:
+                submit_config = Branch.open(submit_branch).get_config()
+                mail_to = submit_config.get_user_option("child_submit_to")
+
             stored_public_branch = branch.get_public_branch()
             if public_branch is None:
                 public_branch = stored_public_branch

=== modified file 'bzrlib/tests/blackbox/test_send.py'
--- a/bzrlib/tests/blackbox/test_send.py	2007-11-30 21:10:18 +0000
+++ b/bzrlib/tests/blackbox/test_send.py	2008-03-06 05:28:23 +0000
@@ -203,6 +203,17 @@
         self.run_bzr_error(('Unknown mail client: bogus',),
                            'send -f branch')
 
+    def test_mailto_child_option(self):
+        """Make sure that child_submit_to is used."""
+        self.make_trees()
+        branch = _mod_branch.Branch.open('branch')
+        branch.get_config().set_user_option('mail_client', 'bogus')
+        parent = _mod_branch.Branch.open('parent')
+        parent.get_config().set_user_option('child_submit_to', 
+                           'somebody at example.org')
+        self.run_bzr_error(('Unknown mail client: bogus',),
+                           'send -f branch')
+
     def test_format(self):
         self.make_trees()
         s = StringIO(self.run_bzr('send -f branch -o- --format=4')[0])




More information about the bazaar-commits mailing list