Rev 3226: merge bzr.dev in file:///v/home/vila/src/bzr/experimental/selftest/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Mar 24 21:49:31 GMT 2008


At file:///v/home/vila/src/bzr/experimental/selftest/

------------------------------------------------------------
revno: 3226
revision-id: v.ladeuil+lp at free.fr-20080324214927-u18zwi46zcd4lr5q
parent: v.ladeuil+lp at free.fr-20080324141010-c09hfv4swd4bo4ky
parent: pqm at pqm.ubuntu.com-20080323231145-nh7pyfd19alqp471
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: selftest
timestamp: Mon 2008-03-24 22:49:27 +0100
message:
  merge bzr.dev
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/mail_client.py          mail_client.py-20070809192806-vuxt3t19srtpjpdn-1
  bzrlib/tests/test_mail_client.py test_mail_client.py-20070809192806-vuxt3t19srtpjpdn-2
    ------------------------------------------------------------
    revno: 3193.1.109
    revision-id: pqm at pqm.ubuntu.com-20080323231145-nh7pyfd19alqp471
    parent: pqm at pqm.ubuntu.com-20080323213924-jw60nko0lafszdaa
    parent: aaron at aaronbentley.com-20080323202505-wno4cb15yplis76c
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: +trunk
    timestamp: Sun 2008-03-23 23:11:45 +0000
    message:
      Fix DefaultMail.compose_merge_request basename (james_w)
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/mail_client.py          mail_client.py-20070809192806-vuxt3t19srtpjpdn-1
      bzrlib/tests/test_mail_client.py test_mail_client.py-20070809192806-vuxt3t19srtpjpdn-2
    ------------------------------------------------------------
    revno: 3193.108.2
    revision-id: aaron at aaronbentley.com-20080323202505-wno4cb15yplis76c
    parent: aaron at aaronbentley.com-20080323202124-6r9rff77fd1skq6q
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.ab.integration
    timestamp: Sun 2008-03-23 16:25:05 -0400
    message:
      Add NEWS entry
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3193.108.1
    revision-id: aaron at aaronbentley.com-20080323202124-6r9rff77fd1skq6q
    parent: pqm at pqm.ubuntu.com-20080323200233-gaiwmyujgxauj4ve
    parent: jw+debian at jameswestby.net-20080319201306-wfrwtqs2n536gspa
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.ab.integration
    timestamp: Sun 2008-03-23 16:21:24 -0400
    message:
      Merge fix from James Westby
    modified:
      bzrlib/mail_client.py          mail_client.py-20070809192806-vuxt3t19srtpjpdn-1
      bzrlib/tests/test_mail_client.py test_mail_client.py-20070809192806-vuxt3t19srtpjpdn-2
    ------------------------------------------------------------
    revno: 3193.107.2
    revision-id: jw+debian at jameswestby.net-20080319201306-wfrwtqs2n536gspa
    parent: jw+debian at jameswestby.net-20080316144110-p76en6snhpcfv028
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: merge_request
    timestamp: Wed 2008-03-19 20:13:06 +0000
    message:
      Add a smoke test to check that the DefaultMail client passes through
      the args correctly.
    modified:
      bzrlib/tests/test_mail_client.py test_mail_client.py-20070809192806-vuxt3t19srtpjpdn-2
    ------------------------------------------------------------
    revno: 3193.107.1
    revision-id: jw+debian at jameswestby.net-20080316144110-p76en6snhpcfv028
    parent: pqm at pqm.ubuntu.com-20080313004030-mff9aq1jfg13n0qi
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: merge_request
    timestamp: Sun 2008-03-16 14:41:10 +0000
    message:
      Fix the other implementation of compose_merge_request to accept basename.
    modified:
      bzrlib/mail_client.py          mail_client.py-20070809192806-vuxt3t19srtpjpdn-1
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2008-03-23 21:39:24 +0000
+++ b/NEWS	2008-03-23 23:11:45 +0000
@@ -46,6 +46,8 @@
     * Don't ask for a password if there is no real terminal.
       (Alexander Belchenko, #69851)
 
+    * Implement handling of basename parameter for DefaultMail.  (James Westby)
+
   DOCUMENTATION:
 
   API BREAKS:

=== modified file 'bzrlib/mail_client.py'
--- a/bzrlib/mail_client.py	2008-03-12 05:59:01 +0000
+++ b/bzrlib/mail_client.py	2008-03-16 14:41:10 +0000
@@ -346,11 +346,11 @@
             return Editor(self.config).compose(prompt, to, subject,
                           attachment, mimie_subtype, extension)
 
-    def compose_merge_request(self, to, subject, directive):
+    def compose_merge_request(self, to, subject, directive, basename=None):
         """See MailClient.compose_merge_request"""
         try:
             return self._mail_client().compose_merge_request(to, subject,
-                                                             directive)
+                    directive, basename=basename)
         except errors.MailClientNotFound:
             return Editor(self.config).compose_merge_request(to, subject,
-                          directive)
+                          directive, basename=basename)

=== modified file 'bzrlib/tests/test_mail_client.py'
--- a/bzrlib/tests/test_mail_client.py	2008-03-02 16:54:19 +0000
+++ b/bzrlib/tests/test_mail_client.py	2008-03-19 20:13:06 +0000
@@ -159,3 +159,34 @@
         self.assertContainsRe(prompt, u'foo\u1234(.|\n)*bar\u1234'
                               u'(.|\n)*baz\u1234(.|\n)*qux\u1234')
         editor._get_merge_prompt(u'foo', u'bar', u'baz', 'qux\xff')
+
+
+class DummyMailClient(object):
+
+    def compose_merge_request(self, *args, **kwargs):
+        self.args = args
+        self.kwargs = kwargs
+
+
+class DefaultMailDummyClient(mail_client.DefaultMail):
+
+    def __init__(self):
+        self.client = DummyMailClient()
+
+    def _mail_client(self):
+        return self.client
+
+
+class TestDefaultMail(tests.TestCase):
+
+    def test_compose_merge_request(self):
+        client = DefaultMailDummyClient()
+        to = "a at b.com"
+        subject = "[MERGE]"
+        directive = "directive",
+        basename = "merge"
+        client.compose_merge_request(to, subject, directive,
+                                     basename=basename)
+        dummy_client = client.client
+        self.assertEqual(dummy_client.args, (to, subject, directive))
+        self.assertEqual(dummy_client.kwargs, {"basename":basename})



More information about the bazaar-commits mailing list