Login | Register
My pages Projects Community openCollabNet

Discussions > svn > svn commit: r36822 - in trunk: subversion/bindings/swig/python/svn subversion/tests/cmdline/svntest tools/dev

subversion
Discussion topic

Back to topic list

svn commit: r36822 - in trunk: subversion/bindings/swig/python/svn subversion/tests/cmdline/svntest tools/dev

Author arfrever
Full name Arfrever Frehtes Taifersar Arahesis
Date 2009-03-28 08:31:18 PDT
Message Author: arfrever
Date: Sat Mar 28 08:30:10 2009
New Revision: 36822

Log:
Python 3 compatibility:
Don't use cmp().

* subversion/bindings/​swig/python/svn/core​.py:
* subversion/tests/cmd​line/svntest/tree.py​:
* tools/dev/contribulyze.py:
* tools/dev/trails.py: Don't use cmp().

Modified:
   trunk/subversion/bin​dings/swig/python/sv​n/core.py
   trunk/subversion/tes​ts/cmdline/svntest/t​ree.py
   trunk/tools/dev/contribulyze.py
   trunk/tools/dev/trails.py

Modified: trunk/subversion/bin​dings/swig/python/sv​n/core.py
URL: http://svn.collab.ne​t/viewvc/svn/trunk/s​ubversion/bindings/s​wig/python/svn/core.​py?pathrev=36822​&r1=36821&r2=368​22
====================​====================​====================​==================
--- trunk/subversion/bin​dings/swig/python/sv​n/core.py Sat Mar 28 08:21:55 2009 (r36821)
+++ trunk/subversion/bin​dings/swig/python/sv​n/core.py Sat Mar 28 08:30:10 2009 (r36822)
@@ -121,7 +121,7 @@ def svn_path_compare_paths(path1, path2)
 
   # Common prefix was skipped above, next character is compared to
   # determine order
- return cmp(char1, char2)
+ return (char1 > char2) - (char1 < char2)
 
 def svn_mergeinfo_merge(mergeinfo, changes):
   return _libsvncore.svn_swig​_mergeinfo_merge(mer​geinfo, changes)

Modified: trunk/subversion/tes​ts/cmdline/svntest/t​ree.py
URL: http://svn.collab.ne​t/viewvc/svn/trunk/s​ubversion/tests/cmdl​ine/svntest/tree.py?​pathrev=36822&r1​=36821&r2=36822
====================​====================​====================​==================
--- trunk/subversion/tes​ts/cmdline/svntest/t​ree.py Sat Mar 28 08:21:55 2009 (r36821)
+++ trunk/subversion/tes​ts/cmdline/svntest/t​ree.py Sat Mar 28 08:30:10 2009 (r36822)
@@ -280,7 +280,7 @@ class SVNTreeNode:
     """Define a simple ordering of two nodes without regard to their full
     path (i.e. position in the tree). This can be used for sorting the
     children within a directory."""
- return cmp(self.name, other.name)
+ return (self.name > other.name) - (self.name < other.name)
 
   def as_state(self, prefix=None):
     root = self

Modified: trunk/tools/dev/contribulyze.py
URL: http://svn.collab.ne​t/viewvc/svn/trunk/t​ools/dev/contribulyz​e.py?pathrev=36822​&r1=36821&r2=3​6822
====================​====================​====================​==================
--- trunk/tools/dev/contribulyze.py Sat Mar 28 08:21:55 2009 (r36821)
+++ trunk/tools/dev/contribulyze.py Sat Mar 28 08:30:10 2009 (r36822)
@@ -235,9 +235,9 @@ class Contributor:
       return 1
     if other.is_full_committer and not self.is_full_committer:
       return -1
- result = cmp(self.score(), other.score())
+ result = (self.score() > other.score()) - (self.score() < other.score())
     if result == 0:
- return cmp(self.big_name(), other.big_name())
+ return (self.big_name() > other.big_name()) - (self.big_name() < other.big_name())
     else:
       return 0 - result
 

Modified: trunk/tools/dev/trails.py
URL: http://svn.collab.ne​t/viewvc/svn/trunk/t​ools/dev/trails.py?p​athrev=36822&r1=​36821&r2=36822
====================​====================​====================​==================
--- trunk/tools/dev/trails.py Sat Mar 28 08:21:55 2009 (r36821)
+++ trunk/tools/dev/trails.py Sat Mar 28 08:30:10 2009 (r36822)
@@ -74,9 +74,9 @@ def output_summary(trails, outfile):
 def _freqtable_cmp(a_b, c_d):
   (a, b) = a_b
   (c, d) = c_d
- c = cmp(d, b)
+ c = (d > b) - (d < b)
   if not c:
- c = cmp(a, c)
+ c = (a > c) - (a < c)
   return c
 
 def list_frequencies(list):

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r36822 - in trunk: subversion/bindings/swig/python/svn subversion/tests/cmdline/svntest tools/dev arfrever Arfrever Frehtes Taifersar Arahesis 2009-03-28 08:31:18 PDT
Messages per page: