Rev 3849: (Matt) Let _format_version_tuple accept alphas/betas/RCs with 0 in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Nov 25 15:22:35 GMT 2008


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

------------------------------------------------------------
revno: 3849
revision-id: pqm at pqm.ubuntu.com-20081125152232-c22rycit2dfzm11f
parent: pqm at pqm.ubuntu.com-20081125021810-2dhu9lqkn6nh5bhn
parent: mnordhoff at mattnordhoff.com-20081123141208-ao19kbt7n31c13oq
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2008-11-25 15:22:32 +0000
message:
  (Matt) Let _format_version_tuple accept alphas/betas/RCs with 0
  	sub-releases.
modified:
  bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
    ------------------------------------------------------------
    revno: 3847.1.1
    revision-id: mnordhoff at mattnordhoff.com-20081123141208-ao19kbt7n31c13oq
    parent: pqm at pqm.ubuntu.com-20081121221932-44m8c85k5ri8h5hg
    committer: Matt Nordhoff <mnordhoff at mattnordhoff.com>
    branch nick: format-alpha-0
    timestamp: Sun 2008-11-23 14:12:08 +0000
    message:
      Let _format_version_tuple accept alphas/betas/rcs with a subrelease of 0.
      
      This is sometimes seen in Python's sys.version_info, presumably in svn builds or something.
    modified:
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
=== modified file 'bzrlib/__init__.py'
--- a/bzrlib/__init__.py	2008-11-13 17:54:19 +0000
+++ b/bzrlib/__init__.py	2008-11-23 14:12:08 +0000
@@ -64,7 +64,7 @@
     and the typical presentation used in Python output.
 
     This also checks that the version is reasonable: the sub-release must be
-    zero for final releases, and non-zero for alpha, beta and preview.
+    zero for final releases.
 
     >>> print _format_version_tuple((1, 0, 0, 'final', 0))
     1.0
@@ -94,9 +94,9 @@
         __sub_string = ''
     elif __release_type == 'dev' and __sub == 0:
         __sub_string = 'dev'
-    elif __release_type in ('alpha', 'beta') and __sub != 0:
+    elif __release_type in ('alpha', 'beta'):
         __sub_string = __release_type[0] + str(__sub)
-    elif __release_type == 'candidate' and __sub != 0:
+    elif __release_type == 'candidate':
         __sub_string = 'rc' + str(__sub)
     else:
         raise ValueError("version_info %r not valid" % (version_info,))




More information about the bazaar-commits mailing list