[Pkg-bazaar-commits] ./bzr-pqm/unstable r60: merge new upstream release.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:23:55 UTC 2009


------------------------------------------------------------
revno: 60
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: debian
timestamp: Sat 2008-08-23 19:27:11 +0200
message:
  merge new upstream release.
modified:
  __init__.py
  debian/changelog
  pqm_submit.py
  setup.py
  test_pqm_submit.py
    ------------------------------------------------------------
    revno: 51.1.1
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: pqm
    timestamp: Tue 2008-03-11 02:34:10 -0400
    message:
      Update to use public iter_changes
    modified:
      pqm_submit.py
    ------------------------------------------------------------
    revno: 51.1.2
    committer: James Henstridge <james at jamesh.id.au>
    branch nick: bzr-pqm.jamesh
    timestamp: Tue 2008-03-18 10:45:02 +0900
    message:
      Update version number to 1.3.0dev0 since we're depending on new API from 
      bzr-1.3 now.
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 51.1.3
    committer: James Henstridge <james at jamesh.id.au>
    branch nick: bzr-pqm.jamesh
    timestamp: Tue 2008-03-25 14:08:50 +0900
    message:
      * Use the standard NoPublicBranch exception to complain about a missing 
        public_branch rather than BzrCommandError.
      * Add a NoPQMSubmissionAddress exception for the case when pqm_email is 
        missing from the config file.
    modified:
      pqm_submit.py
      test_pqm_submit.py
    ------------------------------------------------------------
    revno: 51.1.4
    committer: James Henstridge <james at jamesh.id.au>
    branch nick: bzr-pqm.jamesh
    timestamp: Tue 2008-04-01 18:00:47 +0800
    message:
      Merge John's changes to make --message mandatory.
    modified:
      __init__.py
      pqm_submit.py
      test_pqm_submit.py
        ------------------------------------------------------------
        revno: 51.2.1
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: pqm
        timestamp: Sat 2008-03-15 16:24:11 +0000
        message:
          Require using the --message flag.
        modified:
          __init__.py
          pqm_submit.py
          test_pqm_submit.py
        ------------------------------------------------------------
        revno: 51.2.2
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: pqm
        timestamp: Sat 2008-03-15 16:24:44 +0000
        message:
          Only allow 'open containing' if you are sitting in a subdir.
        modified:
          __init__.py
    ------------------------------------------------------------
    revno: 51.1.5
    committer: James Henstridge <james at jamesh.id.au>
    branch nick: bzr-pqm.jamesh
    timestamp: Tue 2008-04-01 18:18:32 +0800
    message:
      Small formatting fixes for exception messages
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 51.1.6
    tags: upstream-1.3.0
    committer: James Henstridge <james at jamesh.id.au>
    branch nick: bzr-pqm.jamesh
    timestamp: Thu 2008-04-03 17:23:19 +0800
    message:
      * Bump version number to 1.3.0 final.
      * Update copyright headers on files.
    modified:
      __init__.py
      pqm_submit.py
      setup.py
      test_pqm_submit.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2007-12-17 14:47:53 +0000
+++ b/__init__.py	2008-04-03 09:23:19 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007 by Canonical Ltd
+# Copyright (C) 2005-2008 by Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -10,9 +10,9 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 """Functionality for controlling a Patch Queue Manager (pqm).
 """
 
@@ -22,12 +22,12 @@
 from bzrlib.bzrdir import BzrDir
 
 
-version_info = (1, 0, 0, 'dev', 0)
+version_info = (1, 3, 0, 'final', 0)
 
 if version_info[3] == 'final':
     version_string = '%d.%d.%d' % version_info[:3]
 else:
-    version_string = '%d.%d.%d.%s.%d' % version_info
+    version_string = '%d.%d.%d%s%d' % version_info
 __version__ = version_string
 
 
@@ -84,8 +84,8 @@
 
     def run(self, location=None, message=None, public_location=None,
             dry_run=False, submit_branch=None):
+        from bzrlib import errors, trace
         if __name__ != 'bzrlib.plugins.pqm':
-            from bzrlib import trace
             trace.warning('The bzr-pqm plugin needs to be called'
                           ' "bzrlib.plugins.pqm" not "%s"\n'
                           'Please rename the plugin.',
@@ -96,13 +96,14 @@
         if location is None:
             location = '.'
         tree, b, relpath = BzrDir.open_containing_tree_or_branch(location)
-        if relpath and not tree:
-            from bzrlib import errors
-            raise errors.BzrCommandError('No working tree was found, but we'
-                                          ' were not given the exact path to'
-                                          ' the branch.\n'
-                                          ' We found the branch at: %s'
-                                          % (b.base,))
+        if relpath and not tree and location != '.':
+            raise errors.BzrCommandError(
+                'No working tree was found, but we were not given the '
+                'exact path to the branch.\n'
+                'We found a branch at: %s' % (b.base,))
+        if message is None:
+            raise errors.BzrCommandError(
+                'You must supply a commit message for the pqm to use.')
         submit(b, message=message, dry_run=dry_run,
                public_location=public_location,
                submit_location=submit_branch,

=== modified file 'debian/changelog'
--- a/debian/changelog	2008-01-17 22:38:20 +0000
+++ b/debian/changelog	2008-08-23 17:27:11 +0000
@@ -1,3 +1,9 @@
+bzr-pqm (1.3.0-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Jelmer Vernooij <jelmer at samba.org>  Sat, 23 Aug 2008 19:26:52 +0200
+
 bzr-pqm (0.92.0-1) unstable; urgency=low
 
   [ Jelmer Vernooij ]

=== modified file 'pqm_submit.py'
--- a/pqm_submit.py	2007-12-17 11:52:58 +0000
+++ b/pqm_submit.py	2008-04-03 09:23:19 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007 by Canonical Ltd
+# Copyright (C) 2005-2008 by Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -10,9 +10,9 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 """Submit an email to a Patch Queue Manager"""
 
 from bzrlib import (
@@ -37,6 +37,15 @@
         self.msg = message
 
 
+class NoPQMSubmissionAddress(errors.BzrError):
+
+    _fmt = "No PQM submission email address specified for %(branch_url)s."
+
+    def __init__(self, branch):
+        branch_url = urlutils.unescape_for_display(branch.base, 'ascii')
+        errors.BzrError.__init__(self, branch_url=branch_url)
+
+
 class PQMEmailMessage(EmailMessage):
     """PQM doesn't support proper email subjects, so we hack around it."""
 
@@ -87,10 +96,7 @@
                     public_location = urlutils.join(public_repo, branch_relpath)
 
             if public_location is None:
-                raise errors.BzrCommandError(
-                    'No public branch location given.  Please specify with '
-                    '--public-location or see "bzr help pqm-submit" to see how '
-                    'to set it in ~/.bazaar/locations.conf')
+                raise errors.NoPublicBranch(self.source_branch)
         self.public_location = public_location
 
         if submit_location is None:
@@ -118,10 +124,7 @@
         self.submit_location = submit_location
 
         # Check that the message is okay to pass to PQM
-        if message is None:
-            repository = self.source_branch.repository
-            rev = repository.get_revision(self.source_branch.last_revision())
-            message = rev.message
+        assert message is not None
         self.message = message.encode('utf8')
         if '\n' in self.message:
             raise BadCommitMessage(self.message)
@@ -136,7 +139,7 @@
             basis_tree = self.tree.basis_tree()
             basis_tree.lock_read()
             try:
-                for change in self.tree._iter_changes(basis_tree):
+                for change in self.tree.iter_changes(basis_tree):
                     # If we have any changes, the tree is not clean
                     raise errors.UncommittedChanges(self.tree)
             finally:
@@ -197,8 +200,7 @@
     mail_from = mail_from.encode('utf8') # Make sure this isn't unicode
     mail_to = config.get_user_option('pqm_email')
     if not mail_to:
-        raise errors.BzrCommandError('No PQM submission address specified '
-                                     'in configuration')
+        raise NoPQMSubmissionAddress(branch)
     mail_to = mail_to.encode('utf8') # same here
 
     submission.check_tree()

=== modified file 'setup.py'
--- a/setup.py	2007-12-18 00:50:52 +0000
+++ b/setup.py	2008-04-03 09:23:19 +0000
@@ -1,5 +1,5 @@
 #!/usr/bin/env python2.4
-# Copyright (C) 2005, 2006, 2007 Canonical Ltd
+# Copyright (C) 2005-2008 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -11,9 +11,9 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 """A plugin for Bazaar for submitting commands to a PQM service."""
 
 from distutils.core import setup

=== modified file 'test_pqm_submit.py'
--- a/test_pqm_submit.py	2007-11-14 15:47:10 +0000
+++ b/test_pqm_submit.py	2008-04-03 09:23:19 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006 by Canonical Ltd
+# Copyright (C) 2005-2008 by Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -10,9 +10,9 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 """Test cases for pqm submit."""
 
 import smtplib
@@ -235,7 +235,7 @@
     def test_find_public_branch_missing(self):
         source_branch = self.make_branch('source')
         self.assertRaises(
-            errors.BzrCommandError, pqm_submit.PQMSubmission,
+            errors.NoPublicBranch, pqm_submit.PQMSubmission,
             source_branch=source_branch,
             submit_location='submit-branch',
             message='commit message')
@@ -336,6 +336,14 @@
                          call[1:3])
         self.assertContainsRe(call[3], EMAIL)
 
+    def test_pqm_submit_no_message(self):
+        tree = self.make_branch_and_tree('source')
+        tree.commit("one")
+        out, err, connect_calls, sendmail_calls = \
+            self.run_bzr_fakemail(['pqm-submit', './source'],
+                                  retcode=3)
+        self.assertContainsRe(err, 'You must supply a commit message')
+
     def test_dirty_pqm_submit(self):
         source_tree = self.make_branch_and_tree('source')
         self.build_tree(['source/foo'])



More information about the Pkg-bazaar-commits mailing list