subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From troycurti...@apache.org
Subject svn commit: r1816092 - in /subversion/branches/swig-py3/subversion/bindings/swig/python: svn/core.py tests/trac/versioncontrol/svn_fs.py
Date Thu, 23 Nov 2017 00:44:53 GMT
Author: troycurtisjr
Date: Thu Nov 23 00:44:53 2017
New Revision: 1816092

URL: http://svn.apache.org/viewvc?rev=1816092&view=rev
Log:
On branch swig-py3: Explicitly use truncating division to ensure consistent
behavior between Python 2 and 3.

* subversion/bindings/swig/python/svn/core.py,
  subversion/bindings/swig/python/tests/trac/versioncontrol/svn_fs.py
  (secs_from_timestr, SubversionChangeset.__init__,
   SubversionNode.get_last_modified):
  Replace standard division between integers with truncating division, '//'.

Modified:
    subversion/branches/swig-py3/subversion/bindings/swig/python/svn/core.py
    subversion/branches/swig-py3/subversion/bindings/swig/python/tests/trac/versioncontrol/svn_fs.py

Modified: subversion/branches/swig-py3/subversion/bindings/swig/python/svn/core.py
URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/subversion/bindings/swig/python/svn/core.py?rev=1816092&r1=1816091&r2=1816092&view=diff
==============================================================================
--- subversion/branches/swig-py3/subversion/bindings/swig/python/svn/core.py (original)
+++ subversion/branches/swig-py3/subversion/bindings/swig/python/svn/core.py Thu Nov 23 00:44:53
2017
@@ -205,7 +205,7 @@ def secs_from_timestr(svn_datetime, pool
   # ### convert to a time_t; this requires intimate knowledge of
   # ### the apr_time_t type
   # ### aprtime is microseconds; turn it into seconds
-  return aprtime / 1000000
+  return aprtime // 1000000
 
 
 # ============================================================================

Modified: subversion/branches/swig-py3/subversion/bindings/swig/python/tests/trac/versioncontrol/svn_fs.py
URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/subversion/bindings/swig/python/tests/trac/versioncontrol/svn_fs.py?rev=1816092&r1=1816091&r2=1816092&view=diff
==============================================================================
--- subversion/branches/swig-py3/subversion/bindings/swig/python/tests/trac/versioncontrol/svn_fs.py
(original)
+++ subversion/branches/swig-py3/subversion/bindings/swig/python/tests/trac/versioncontrol/svn_fs.py
Thu Nov 23 00:44:53 2017
@@ -366,7 +366,7 @@ class SubversionNode(Node):
     def get_last_modified(self):
         date = fs.revision_prop(self.fs_ptr, self.created_rev,
                                 core.SVN_PROP_REVISION_DATE)
-        return core.svn_time_from_cstring(date) / 1000000
+        return core.svn_time_from_cstring(date) // 1000000
 
     def _get_prop(self, name):
         return fs.node_prop(self.root, self.scoped_path, name)
@@ -382,7 +382,7 @@ class SubversionChangeset(Changeset):
         message = self._get_prop(core.SVN_PROP_REVISION_LOG)
         author = self._get_prop(core.SVN_PROP_REVISION_AUTHOR)
         date = self._get_prop(core.SVN_PROP_REVISION_DATE)
-        date = core.svn_time_from_cstring(date) / 1000000
+        date = core.svn_time_from_cstring(date) // 1000000
         Changeset.__init__(self, rev, message, author, date)
 
     def get_changes(self):



Mime
View raw message