subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r1329505 - in /subversion/trunk/subversion: include/svn_fs.h libsvn_fs/editor.c
Date Mon, 23 Apr 2012 23:16:35 GMT
Author: gstein
Date: Mon Apr 23 23:16:35 2012
New Revision: 1329505

URL: http://svn.apache.org/viewvc?rev=1329505&view=rev
Log:
Avoid overloading the TXN flags, and specify the editor's autocommit
behavior seperately.

Note that the flag has reversed its meaning. I wanted a default of
zero to match the default of "autocommit". Now that it is explicit,
we can say "pass TRUE for default autocommit behavior".

Suggested by: blair

* subversion/include/svn_fs.h:
  (SVN_FS_TXN_NO_AUTOCOMMIT): removed
  (svn_fs_editor_create): add AUTOCOMMIT flag

* subversion/libsvn_fs/editor.c:
  (struct edit_baton): switch to AUTOCOMMIT
  (make_editor): flip semantics of param to AUTOCOMMIT
  (svn_fs_editor_create): add AUTOCOMMIT param and pass along
  (svn_fs_editor_create_for): switch to flag value to FALSE

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

Modified: subversion/trunk/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1329505&r1=1329504&r2=1329505&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Mon Apr 23 23:16:35 2012
@@ -809,10 +809,6 @@ typedef struct svn_fs_txn_t svn_fs_txn_t
  */
 #define SVN_FS_TXN_CHECK_LOCKS                   0x00002
 
-/** Do not auto-commit the txn when its associated editor is marked
- * as completed.
- */
-#define SVN_FS_TXN_NO_AUTOCOMMIT                 0x00004
 /** @} */
 
 /**
@@ -1019,18 +1015,21 @@ svn_fs_change_txn_props(svn_fs_txn_t *tx
  * @{
  */
 
+/* ### docco. note that @a autocommit is typically TRUE.  */
 svn_error_t *
 svn_fs_editor_create(svn_editor_t **editor,
                      const char **txn_name,
                      svn_fs_t *fs,
                      svn_revnum_t revision,
                      apr_uint32_t flags,
+                     svn_boolean_t autocommit,
                      svn_cancel_func_t cancel_func,
                      void *cancel_baton,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool);
 
 
+/* ### docco.  */
 svn_error_t *
 svn_fs_editor_create_for(svn_editor_t **editor,
                          svn_fs_t *fs,

Modified: subversion/trunk/subversion/libsvn_fs/editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/editor.c?rev=1329505&r1=1329504&r2=1329505&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/editor.c (original)
+++ subversion/trunk/subversion/libsvn_fs/editor.c Mon Apr 23 23:16:35 2012
@@ -34,7 +34,7 @@
 
 struct edit_baton {
   svn_fs_txn_t *txn;
-  svn_boolean_t no_autocommit;
+  svn_boolean_t autocommit;
 };
 
 #define UNUSED(x) ((void)(x))
@@ -226,7 +226,7 @@ abort_cb(void *baton,
 static svn_error_t *
 make_editor(svn_editor_t **editor,
             svn_fs_txn_t *txn,
-            svn_boolean_t no_autocommit,
+            svn_boolean_t autocommit,
             svn_cancel_func_t cancel_func,
             void *cancel_baton,
             apr_pool_t *result_pool,
@@ -250,7 +250,7 @@ make_editor(svn_editor_t **editor,
   struct edit_baton *eb = apr_palloc(result_pool, sizeof(*eb));
 
   eb->txn = txn;
-  eb->no_autocommit = no_autocommit;
+  eb->autocommit = autocommit;
 
   SVN_ERR(svn_editor_create(editor, eb, cancel_func, cancel_baton,
                             result_pool, scratch_pool));
@@ -266,17 +266,17 @@ svn_fs_editor_create(svn_editor_t **edit
                      svn_fs_t *fs,
                      svn_revnum_t revision,
                      apr_uint32_t flags,
+                     svn_boolean_t autocommit,
                      svn_cancel_func_t cancel_func,
                      void *cancel_baton,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
 {
   svn_fs_txn_t *txn;
-  svn_boolean_t no_autocommit = (flags & SVN_FS_TXN_NO_AUTOCOMMIT) != 0;
 
   SVN_ERR(svn_fs_begin_txn2(&txn, fs, revision, flags, result_pool));
   SVN_ERR(svn_fs_txn_name(txn_name, txn, result_pool));
-  return svn_error_trace(make_editor(editor, txn, no_autocommit,
+  return svn_error_trace(make_editor(editor, txn, autocommit,
                                      cancel_func, cancel_baton,
                                      result_pool, scratch_pool));
 }
@@ -294,7 +294,7 @@ svn_fs_editor_create_for(svn_editor_t **
   svn_fs_txn_t *txn;
 
   SVN_ERR(svn_fs_open_txn(&txn, fs, txn_name, result_pool));
-  return svn_error_trace(make_editor(editor, txn, TRUE /* no_autocommit */,
+  return svn_error_trace(make_editor(editor, txn, FALSE /* autocommit */,
                                      cancel_func, cancel_baton,
                                      result_pool, scratch_pool));
 }



Mime
View raw message