[Pkg-bazaar-commits] r177 ./bzr-builddeb/trunk: * Add version_info attribute so that bzrlib can find out the version of

James Westby jw+debian at jameswestby.net
Wed Sep 12 20:57:04 UTC 2007


------------------------------------------------------------
revno: 177
committer: James Westby <jw+debian at jameswestby.net>
branch nick: trunk
timestamp: Wed 2007-09-12 21:57:04 +0100
message:
  * Add version_info attribute so that bzrlib can find out the version of
    the plugin. Please try and remember to update it when releasing (set
    the word to 'final').
added:
  tests/test_version.py
modified:
  __init__.py
  debian/changelog
  tests/__init__.py
-------------- next part --------------
=== added file 'tests/test_version.py'
--- a/tests/test_version.py	1970-01-01 00:00:00 +0000
+++ b/tests/test_version.py	2007-09-12 20:57:04 +0000
@@ -0,0 +1,33 @@
+#    test_version.py -- Testsuite for builddeb version
+#    Copyright (C) 2007 James Westby <jw+debian at jameswestby.net>
+#    
+#    This file is part of bzr-builddeb.
+#
+#    bzr-builddeb is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or
+#    (at your option) any later version.
+#
+#    bzr-builddeb is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    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 bzr-builddeb; if not, write to the Free Software
+#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+from bzrlib.plugins import builddeb
+
+import bzrlib
+from bzrlib.tests import TestCase, KnownFailure
+from bzrlib.trace import error
+
+class VersionTests(TestCase):
+
+  def test_version_matches(self):
+    """An abused test case to warn when the version doesn't match bzrlib."""
+    if builddeb.version_info != bzrlib.version_info:
+      raise KnownFailure("builddeb version doesn't match bzrlib version")
+

=== modified file '__init__.py'
--- a/__init__.py	2007-09-01 16:33:47 +0000
+++ b/__init__.py	2007-09-12 20:57:04 +0000
@@ -45,6 +45,18 @@
 from properties import BuildProperties
 from util import goto_branch, find_changelog, tarball_name
 
+
+# same format as sys.version_info: "A tuple containing the five components of
+# the version number: major, minor, micro, releaselevel, and serial. All
+# values except releaselevel are integers; the release level is 'alpha',
+# 'beta', 'candidate', or 'final'. The version_info value corresponding to the
+# Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
+# releaselevel of 'dev' for unreleased under-development code.
+#
+# Please set this to 'final' before upload.
+version_info = (0, 91, 0, 'dev', 0)
+
+
 dont_purge_opt = Option('dont-purge',
     help="Don't purge the build directory after building")
 result_opt = Option('result',
@@ -74,6 +86,7 @@
 global_conf = os.path.expanduser('~/.bazaar/builddeb.conf')
 local_conf = os.path.join(builddeb_dir, 'local.conf')
 
+
 class cmd_builddeb(Command):
   """Builds a Debian package from a branch.
 
@@ -446,6 +459,7 @@
     result.addTest(tests.test_suite())
     return result
 
+
 if __name__ == '__main__':
   print ("This is a Bazaar plugin. Copy this directory to ~/.bazaar/plugins "
           "to use it.\n")

=== modified file 'debian/changelog'
--- a/debian/changelog	2007-09-05 20:58:44 +0000
+++ b/debian/changelog	2007-09-12 20:57:04 +0000
@@ -9,8 +9,11 @@
     upstream's tarball, which was causing havoc with dh-make-php packages.
     Thanks to Mark A. Hershberger for the report and Adeodato Sim?
     for the pointer to the fix. (Closes: #440069)
+  * Add version_info attribute so that bzrlib can find out the version of
+    the plugin. Please try and remember to update it when releasing (set
+    the word to 'final').
 
- -- James Westby <jw+debian at jameswestby.net>  Wed, 05 Sep 2007 21:56:31 +0100
+ -- James Westby <jw+debian at jameswestby.net>  Wed, 12 Sep 2007 21:55:54 +0100
 
 bzr-builddeb (0.90) unstable; urgency=low
 

=== modified file 'tests/__init__.py'
--- a/tests/__init__.py	2007-07-01 14:23:31 +0000
+++ b/tests/__init__.py	2007-09-12 20:57:04 +0000
@@ -136,6 +136,7 @@
             'test_import_dsc',
             'test_repack_tarball_extra',
             'test_util',
+            'test_version',
             ]
     suite.addTest(loader.loadTestsFromModuleNames(["%s.%s" % (__name__, i)
                                             for i in testmod_names]))



More information about the Pkg-bazaar-commits mailing list