You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/08/12 02:08:46 UTC

svn commit: r1156862 - in /subversion/branches/fs-py/subversion: libsvn_fs_py/fs_fs.c python/svn/fs.py

Author: hwright
Date: Fri Aug 12 00:08:46 2011
New Revision: 1156862

URL: http://svn.apache.org/viewvc?rev=1156862&view=rev
Log:
On the fs-py branch:
Gut another function and replace with its Python counterpart.

* subversion/python/svn/fs.py
  (FS.__ensure_revision_exists): Rename to FS._ensure_revision_exists.
  (FS._set_revision_proplist): Update caller.

* subversion/libsvn_fs_py/fs_fs.c
  (ensure_revision_exists): 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=1156862&r1=1156861&r2=1156862&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 Fri Aug 12 00:08:46 2011
@@ -1827,24 +1827,8 @@ ensure_revision_exists(svn_fs_t *fs,
 {
   fs_fs_data_t *ffd = fs->fsap_data;
 
-  if (! SVN_IS_VALID_REVNUM(rev))
-    return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-                             _("Invalid revision number '%ld'"), rev);
-
-
-  /* Did the revision exist the last time we checked the current
-     file? */
-  if (rev <= ffd->youngest_rev_cache)
-    return SVN_NO_ERROR;
-
-  SVN_ERR(get_youngest(&(ffd->youngest_rev_cache), fs->path, pool));
-
-  /* Check again. */
-  if (rev <= ffd->youngest_rev_cache)
-    return SVN_NO_ERROR;
-
-  return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-                           _("No such revision %ld"), rev);
+  return svn_error_trace(svn_fs_py__call_method(NULL, ffd->p_fs,
+                                 "_ensure_revision_exists", "(l)", rev));
 }
 
 /* Open the correct revision file for REV.  If the filesystem FS has

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=1156862&r1=1156861&r2=1156862&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/python/svn/fs.py (original)
+++ subversion/branches/fs-py/subversion/python/svn/fs.py Fri Aug 12 00:08:46 2011
@@ -111,7 +111,7 @@ class FS(object):
         shutil.copymode(self.__path_current, self.__path_uuid)
 
 
-    def __ensure_revision_exists(self, rev):
+    def _ensure_revision_exists(self, rev):
         if not svn.is_valid_revnum(rev):
             raise svn.SubversionException(svn.err.FS_NO_SUCH_REVISION,
                                     _("Invalid revision number '%ld'") % rev)
@@ -129,7 +129,7 @@ class FS(object):
                                       _("No such revision %ld") % rev)
 
     def _set_revision_proplist(self, rev, props):
-        self.__ensure_revision_exists(rev)
+        self._ensure_revision_exists(rev)
 
         final_path = self.__path_revprops(rev)
         (fd, fn) = tempfile.mkstemp(dir=os.path.dirname(final_path))