You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2013/05/23 06:31:21 UTC

svn commit: r1485568 - /subversion/trunk/tools/dist/release.py

Author: danielsh
Date: Thu May 23 04:31:21 2013
New Revision: 1485568

URL: http://svn.apache.org/r1485568
Log:
Mostly-stylistic tweaks.

* tools/dist/release.py
  (Version.regex): Quote backslashes in a manner guaranteed to work.
  (Version.__str, Version.__str__): Unify these two identical methods
    under the latter, which is standard.  Callers updated.
  (Verify.__repr__): Use an equivalent but more pedantic way
    of constructing the return value.

Modified:
    subversion/trunk/tools/dist/release.py

Modified: subversion/trunk/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/release.py?rev=1485568&r1=1485567&r2=1485568&view=diff
==============================================================================
--- subversion/trunk/tools/dist/release.py (original)
+++ subversion/trunk/tools/dist/release.py Thu May 23 04:31:21 2013
@@ -104,7 +104,7 @@ extns = ['zip', 'tar.gz', 'tar.bz2']
 # Utility functions
 
 class Version(object):
-    regex = re.compile('(\d+).(\d+).(\d+)(?:-(?:(rc|alpha|beta)(\d+)))?')
+    regex = re.compile(r'(\d+).(\d+).(\d+)(?:-(?:(rc|alpha|beta)(\d+)))?')
 
     def __init__(self, ver_str):
         # Special case the 'trunk-nightly' version
@@ -160,7 +160,7 @@ class Version(object):
         else:
             return self.pre_num < that.pre_num
 
-    def __str(self):
+    def __str__(self):
         if self.pre:
             if self.pre == 'nightly':
                 return 'nightly'
@@ -173,11 +173,7 @@ class Version(object):
 
     def __repr__(self):
 
-        return "Version('%s')" % self.__str()
-
-    def __str__(self):
-        return self.__str()
-
+        return "Version(%s)" % repr(str(self))
 
 def get_prefix(base_dir):
     return os.path.join(base_dir, 'prefix')