Author: hwright
Date: Thu Aug 11 21:07:56 2011
New Revision: 1156831

URL: http://svn.apache.org/viewvc?rev=1156831&view=rev
Log:
On the fs-py branch:
Implement the youngest_rev() interface in Python.

* subversion/python/svn/fs.py
  (FS.youngest_rev): New.

* subversion/libsvn_fs_py/fs_fs.c
  (svn_fs_py__youngest_rev): Call the Python method.

Modified:
    subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c
    subversion/branches/fs-py/subversion/python/svn/fs.py

Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c?rev=1156831&r1=1156830&r2=1156831&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c Thu Aug 11 
21:07:56 2011
@@ -1734,8 +1734,15 @@ svn_fs_py__youngest_rev(svn_revnum_t *yo
                         apr_pool_t *pool)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
+  PyObject *p_rev;
+
+  SVN_ERR(svn_fs_py__call_method(&p_rev, ffd->p_fs,
+                                 "youngest_rev", "()"));
+
+  *youngest_p = PyInt_AsLong(p_rev);
+
+  Py_DECREF(p_rev);
 
-  SVN_ERR(get_youngest(youngest_p, fs->path, pool));
   ffd->youngest_rev_cache = *youngest_p;
 
   return SVN_NO_ERROR;

Modified: subversion/branches/fs-py/subversion/python/svn/fs.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/python/svn/fs.py?rev=1156831&r1=1156830&r2=1156831&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/python/svn/fs.py (original)
+++ subversion/branches/fs-py/subversion/python/svn/fs.py Thu Aug 11 21:07:56 
2011
@@ -91,6 +91,10 @@ class FS(object):
     def _get_youngest(self):
         return int(self.__read_current()[0])
 
+    def youngest_rev(self):
+        self.__youngest_rev_cache = self._get_youngest()
+        return self.__youngest_rev_cache
+
     def set_uuid(self, uuid_in = None):
         '''Set the UUID for the filesystem.  If UUID_IN is not given, generate
            a new one a la RFC 4122.'''


Reply via email to