subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r1330037 - in /subversion/trunk/subversion: include/svn_error_codes.h include/svn_fs.h libsvn_fs/editor.c
Date Tue, 24 Apr 2012 21:53:56 GMT
Author: gstein
Date: Tue Apr 24 21:53:56 2012
New Revision: 1330037

URL: http://svn.apache.org/viewvc?rev=1330037&view=rev
Log:
Add a new function to fetch commit information after
svn_editor_complete() has been called on an FS editor.

(not super happy with this API right now; comments welcome)

* subversion/include/svn_fs.h:
  (svn_fs_editor_get_commit_results): new declaration

* subversion/include/svn_error_codes.h:
  (SVN_ERR_FS_NO_EDITOR_COMMIT_RESULTS): new error code, in case
    somebody calls get_commit_results() at the wrong time

* subversion/libsvn_fs/editor.c:
  (svn_fs_editor_get_commit_results): new stub implementation

Modified:
    subversion/trunk/subversion/include/svn_error_codes.h
    subversion/trunk/subversion/include/svn_fs.h
    subversion/trunk/subversion/libsvn_fs/editor.c

Modified: subversion/trunk/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_error_codes.h?rev=1330037&r1=1330036&r2=1330037&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_error_codes.h (original)
+++ subversion/trunk/subversion/include/svn_error_codes.h Tue Apr 24 21:53:56 2012
@@ -767,6 +767,11 @@ SVN_ERROR_START
              "Property value in filesystem differs from the provided "
              "base value")
 
+  /** @since New in 1.8. */
+  SVN_ERRDEF(SVN_ERR_FS_NO_EDITOR_COMMIT_RESULTS,
+             SVN_ERR_FS_CATEGORY_START + 50,
+             "The editor has not committed the underlying transaction")
+
   /* repos errors */
 
   SVN_ERRDEF(SVN_ERR_REPOS_LOCKED,

Modified: subversion/trunk/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1330037&r1=1330036&r2=1330037&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Tue Apr 24 21:53:56 2012
@@ -1083,6 +1083,38 @@ svn_fs_editor_create_for(svn_editor_t **
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 
+
+/**
+ * After svn_editor_complete() has been called on @a editor, this function
+ * is used to fetch the results of the underlying commit operation. If a
+ * commit has not occurred (because svn_editor_complete() has not been
+ * called, or the autocommit flag was #FALSE), then
+ * #SVN_ERR_FS_NO_EDITOR_COMMIT_RESULTS will be returned.
+ *
+ * @a revision will be set to the committed revision, if any. If
+ * svn_editor_complete() does not return an error, then a revision number
+ * will be returned. If any error is returned by svn_editor_complete(),
+ * then @a revision will be set to #SVN_INVALID_REVNUM.
+ *
+ * @a post_commit_err contains any error that may have occurred after the
+ * revision was committed (ie. during FS transaction cleanup). If no such
+ * error occurred, then @a post_commit_err will be set to @c NULL.
+ *
+ * If the svn_editor_complete() call returned #SVN_ERR_FS_CONFLICT, then
+ * this function will place the conflicted path into @a conflict_path.
+ * In this situation, @a revision will be set to #SVN_INVALID_REVNUM and
+ * @a post_commit_err will be set to @c NULL.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_fs_editor_get_commit_results(svn_revnum_t *revision,
+                                 svn_error_t **post_commit_err,
+                                 const char **conflict_path,
+                                 const svn_editor_t *editor,
+                                 apr_pool_t *result_pool);
+
+
 /** @} */
 
 

Modified: subversion/trunk/subversion/libsvn_fs/editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/editor.c?rev=1330037&r1=1330036&r2=1330037&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/editor.c (original)
+++ subversion/trunk/subversion/libsvn_fs/editor.c Tue Apr 24 21:53:56 2012
@@ -439,3 +439,21 @@ svn_fs_editor_create_for(svn_editor_t **
                                      result_pool, scratch_pool));
 }
 
+
+svn_error_t *
+svn_fs_editor_get_commit_results(svn_revnum_t *revision,
+                                 svn_error_t **post_commit_err,
+                                 const char **conflict_path,
+                                 const svn_editor_t *editor,
+                                 apr_pool_t *result_pool)
+{
+  struct ev2_baton *eb = svn_editor_get_baton(editor);
+
+  UNUSED(eb);
+
+  *revision = SVN_INVALID_REVNUM;
+  *post_commit_err = NULL;
+  *conflict_path = NULL;
+
+  return SVN_NO_ERROR;
+}



Mime
View raw message