gnue-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNUe Version Numbers


From: Randall Whitman
Subject: GNUe Version Numbers
Date: Mon, 09 May 2011 10:19:56 -0700

Does it make sense to call current Designer 0.6-alpha rather than 0.5.7?
Does it make sense to use bzr revno rather than svn info?
/Randall


<common>

=== modified file 'setup.py'
--- setup.py    2010-11-14 13:00:53 +0000
+++ setup.py    2011-02-28 22:43:34 +0000
@@ -38,11 +38,11 @@
 def allfiles(directory, ext=None):
     """
     Get a list of files in a given directory, excluding some specials like
-    Makefile, .svn, CSV and so on
+    Makefile, .svn, CVS and so on
     """
 
     directory = os.path.normpath(directory)
-    exclude = [".svn", "CVS", "README.cvs", ".cvsignore", "Makefile"]
+    exclude = [".bzr", ".bzrignore", ".svn", "CVS", "README.cvs", 
".cvsignore", "Makefile"]
 
     result = []
 
@@ -99,18 +99,18 @@
 
 
 # -----------------------------------------------------------------------------
-# Build the svnrev.py file.
-# Gets called on sdist (always) and on build/install (only when run from SVN).
+# Build the bzrrev.py file.
+# Gets called on sdist (always) and on build/install (only when run from BZR).
 # FIXME: Could be done with svnrev.py.dist_template, but it wouldn't happen on
 # build in that case.
 # -----------------------------------------------------------------------------
 
-def build_svnrev(filename, dry_run):
+def build_bzrrev(filename, dry_run):
 
-    log.info("building svnrev.py")
+    log.info("building bzrrev.py")
     if not dry_run:
         output = open(filename, 'w')
-        output.write('svnrev = %r' % version.get_svn_revision('src'))
+        output.write('bzrrev = %r' % version.get_bzr_revision('src'))
         output.close()
 
 
@@ -189,7 +189,7 @@
     def make_release_tree(self, base_dir, files):
         distutils.command.sdist.sdist.make_release_tree(self, base_dir, files)
         self.__process_templates(base_dir)
-        build_svnrev(os.path.join(base_dir, 'src', 'svnrev.py'), self.dry_run)
+        build_bzrrev(os.path.join(base_dir, 'src', 'bzrrev.py'), self.dry_run)
 
     def __process_templates(self, target):
 
@@ -210,7 +210,7 @@
                 ':MINOR:': str(__version__.minor),
                 ':PHASE:': str(__version__.phase),
                 ':BUILD:': str(__version__.build),
-                ':SVN:': str(__version__.svn),
+                ':BZR:': str(__version__.bzr),
                 ':DATE_ISO:': time.strftime('%Y-%m-%d', time.gmtime()),
                 ':DATE_RFC:': time.strftime('%a, %d %b %Y', time.gmtime()),
                 ':TIME:': time.strftime('%H:%M:%S', time.gmtime())}
@@ -240,7 +240,7 @@
 
 
 # =============================================================================
-# build: if done from SVN, build files to be installed first
+# build: if done from BZR, build files to be installed first
 # =============================================================================
 
 class build(distutils.command.build.build):
@@ -249,8 +249,8 @@
 
         distutils.command.build.build.run(self)
         if not os.path.isfile("PKG-INFO"):
-            build_svnrev(os.path.join(self.build_lib, 'gnue', 'common',
-                'svnrev.py'), self.dry_run)
+            build_bzrrev(os.path.join(self.build_lib, 'gnue', 'common',
+                'bzrrev.py'), self.dry_run)
 
 
 # =============================================================================

=== modified file 'src/__init__.py'
--- src/__init__.py     2009-12-05 16:06:55 +0000
+++ src/__init__.py     2011-05-06 23:35:58 +0000
@@ -29,12 +29,12 @@
 from base import version
 
 try:
-    import svnrev
-    __svn_revision__ = svnrev.svnrev
+    import bzrrev
+    __bzr_revision__ = bzrrev.bzrrev
 except ImportError:
-    __svn_revision__ = None
+    __bzr_revision__ = None
 
-__version__ = version.Version(0, 7, 'alpha', 1, __svn_revision__)
+__version__ = version.Version(0, 7, 'alpha', 1, __bzr_revision__)
 
 PACKAGE = "GNUe-Common"
 TITLE = "GNU Enterprise Common Library"

=== modified file 'src/base/version.py'
--- src/base/version.py 2009-11-02 22:46:34 +0000
+++ src/base/version.py 2011-05-06 23:38:32 +0000
@@ -61,9 +61,9 @@
 Snapshots
 ---------
 
-Some people want to be on the bleeding edge of development and use Subversion
+Some people want to be on the bleeding edge of development and use Bazaar
 snapshots. The version number of such a snapshot is the version number of the
-last build, a "+" sign, the text "svn", a dot, and the Subversion revision.
+last build, a "+" sign, the text "bzr", a dot, and the Subversion revision.
 
 Defining the version number
 ---------------------------
@@ -72,14 +72,14 @@
 assign it to a variable named __version__ in the __init__.py file in the
 package root::
     try:
-        import svnrev
-        __svn_revision__ = svnrev.svnrev
+        import bzrrev
+        __bzr_revision__ = bzrrev.bzrrev
     except ImportError:
-        __svn_revision__ = None
+        __bzr_revision__ = None
     from gnue.common.base import version
-    __version__ = version.Version(0, 1, 'alpha', 1, __svn_revision__)
+    __version__ = version.Version(0, 1, 'alpha', 1, __bzr_revision__)
 
-The above example supports a file "svnrev.py" which defines the Subversion
+The above example supports a file "bzrrev.py" which defines the Bazaar
 snapshot.  This makes it possible to show the full version number of a snapshot
 even if the snapshot was installed from a tarball, if the tarball contains this
 file.  The infrastructure provided in the setup module automatically builds
@@ -89,18 +89,18 @@
 import os
 import sys
 
-__all__ = ['get_svn_revision', 'Version']
-
-
-# =============================================================================
-# Find out current SVN revision
-# =============================================================================
-
-def get_svn_revision(directory):
+__all__ = ['get_bzr_revision', 'Version']
+
+
+# =============================================================================
+# Find out current BZR revision
+# =============================================================================
+
+def get_bzr_revision(directory):
     """
-    Find out the SVN revision of the last change in the current directory.
+    Find out the BZR revision of the last change in the current directory.
 
-    The current directory must be an SVN checkout, and the "svn" command must
+    The current directory must be an BZR checkout, and the "bzr" command must
     be available.
 
     This function only works on POSIX systems. On other systems, it returns
@@ -120,12 +120,11 @@
     if os.path.islink(directory):
         directory = os.readlink(directory)
 
-    cmd = ("LANG=C svn info %s | grep 'Last Changed Rev:' " + \
-            "| sed -e 's/Last Changed Rev: //'") % directory
+    cmd = ("LANG=C bzr revno %s ") % directory
 
     import commands
     # Unfortunately, svn does not set an exit status on all errors, so there's
-    # no use in testing the status.
+    # no use in testing the status.  [what about bzr?]
     output = commands.getoutput(cmd)
     try:
         return int(output)
@@ -150,8 +149,8 @@
 
     Unstable Snapshot
     =================
-        A version number for an unstable SVN snapshot follows the format
-        <major>.<minor>-<phase><build>+svn.<svn> (e.g. "1.5-pre2+svn.9876).
+        A version number for an unstable BZR snapshot follows the format
+        <major>.<minor>-<phase><build>+bzr.<bzr> (e.g. "1.5-pre2+bzr.9876).
 
     Stable Build
     ============
@@ -161,7 +160,7 @@
     Stable Snapshot
     ===============
         A version number for a stable snapshot follows the format
-        <major>.<minor>.<build>+svn.<svn> (e.g. 1.5.2+svn.9876).
+        <major>.<minor>.<build>+bzr.<bzr> (e.g. 1.5.2+bzr.9876).
 
     @ivar major: Major release number
     @ivar minor: Minor release number
@@ -169,8 +168,8 @@
         C{'pre'}, C{'rc'}, or C{'final'}. If the phase is C{'final'}, it is a
         stable version, otherwise it is an unstable version.
     @ivar build: Build number within the phase.
-    @ivar svn: SVN revision number. If this parameter is 0, the version is an
-        explicit build, otherwise it is an SVN snapshot.
+    @ivar bzr: BZR revision number. If this parameter is 0, the version is an
+        explicit build, otherwise it is an BZR snapshot.
     """
 
     __phases = {
@@ -184,7 +183,7 @@
     # Constructor
     # -------------------------------------------------------------------------
 
-    def __init__(self, major, minor, phase, build, svn):
+    def __init__(self, major, minor, phase, build, bzr):
         """
         Create a new Version object instance.
 
@@ -195,9 +194,9 @@
             C{'final'}, it is a stable version, otherwise it is an unstable
             version.
         @param build: Build number within the phase.
-        @param svn: SVN revision number. If this parameter is 0, the version is
-            an explicit build, otherwise it is an SVN snapshot. If this
-            parameter is C{None}, the SVN revision is determined automatically.
+        @param bzr: BZR revision number. If this parameter is 0, the version is
+            an explicit build, otherwise it is an BZR snapshot. If this
+            parameter is C{None}, the BZR revision is determined automatically.
         """
 
         assert isinstance(major, int) and major >= 0 and major < 100
@@ -209,11 +208,11 @@
         self.minor = minor
         self.phase = phase
         self.build = build
-        self.svn = svn
+        self.bzr = bzr
 
-        if self.svn is None:
+        if self.bzr is None:
             caller_file = sys._getframe(1).f_code.co_filename
-            self.svn = get_svn_revision(os.path.dirname(caller_file))
+            self.bzr = get_bzr_revision(os.path.dirname(caller_file))
 
 
     # -------------------------------------------------------------------------
@@ -231,8 +230,8 @@
             result = '%s.%s-%s%s' % (self.major, self.minor, self.phase,
                     self.build)
 
-        if self.svn:
-            result += '+svn.%s' % self.svn
+        if self.bzr:
+            result += '+bzr.%s' % self.bzr
 
         return result
 
@@ -248,13 +247,13 @@
         Later versions will always result in higher numbers.
         """
 
-        if not self.svn:
-            svn = '00'
+        if not self.bzr:
+            bzr = '00'
         else:
-            svn = '80'
+            bzr = '80'
 
         return '%02d%02d%s%01d%s' % (self.major, self.minor,
-                self.__phases[self.phase], self.build, svn)
+                self.__phases[self.phase], self.build, bzr)
 
 
 # =============================================================================

<forms>

=== modified file 'src/__init__.py'
--- src/__init__.py     2009-11-20 21:31:22 +0000
+++ src/__init__.py     2011-05-06 23:36:28 +0000
@@ -24,15 +24,15 @@
 Form management.
 """
 
-from gnue.common.utils import version
+from gnue.common.base import version
 
 try:
-    import svnrev
-    __svn_revision__ = svnrev.svnrev
+    import bzrrev
+    __bzr_revision__ = bzrrev.bzrrev
 except ImportError:
-    __svn_revision__ = None
+    __bzr_revision__ = None
 
-__version__ = version.Version(0, 7, 'alpha', 0, __svn_revision__)
+__version__ = version.Version(0, 7, 'alpha', 0, __bzr_revision__)
 
 PACKAGE = "GNUe-Forms"
 TITLE = "GNU Enterprise Forms"

<designer>

=== modified file 'src/__init__.py'
--- src/__init__.py     2009-12-05 16:06:55 +0000
+++ src/__init__.py     2011-05-06 23:35:22 +0000
@@ -24,15 +24,15 @@
 Form management.
 """
 
-from gnue.common.utils import version
+from gnue.common.base import version
 
 try:
-    import svnrev
-    __svn_revision__ = svnrev.svnrev
+    import bzrrev
+    __bzr_revision__ = bzrrev.bzrrev
 except ImportError:
-    __svn_revision__ = None
+    __bzr_revision__ = None
 
-__version__ = version.Version(0, 5, 'final', 7, __svn_revision__)
+__version__ = version.Version(0, 6, 'alpha', 0, __bzr_revision__)
 
 PACKAGE = "GNUe-Designer"
 TITLE = "GNU Enterprise Designer"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]