You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2015/03/03 14:11:11 UTC

svn commit: r1663697 - /subversion/trunk/subversion/libsvn_fs_base/revs-txns.c

Author: philip
Date: Tue Mar  3 13:11:10 2015
New Revision: 1663697

URL: http://svn.apache.org/r1663697
Log:
When creating a BDB txn the automatic setting of svn:date should
occur earlier so that it is not recorded as an explict setting.

* subversion/libsvn_fs_base/revs-txns.c
  (txn_body_begin_txn): Move svn:date to here from ...
  (svn_fs_base__begin_txn): ... here.
 
Found by: <ev...@visualsvn.com> 

Modified:
    subversion/trunk/subversion/libsvn_fs_base/revs-txns.c

Modified: subversion/trunk/subversion/libsvn_fs_base/revs-txns.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/revs-txns.c?rev=1663697&r1=1663696&r2=1663697&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/revs-txns.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/revs-txns.c Tue Mar  3 13:11:10 2015
@@ -711,6 +711,23 @@ txn_body_begin_txn(void *baton, trail_t
       SVN_ERR(txn_body_change_txn_prop(&cpargs, trail));
     }
 
+  /* Put a datestamp on the newly created txn, so we always know
+     exactly how old it is.  (This will help sysadmins identify
+     long-abandoned txns that may need to be manually removed.) Do
+     this before setting CLIENT_DATE so that it is not recorded as an
+     explicit setting. */
+  {
+    struct change_txn_prop_args cpargs;
+    svn_string_t date;
+    cpargs.fs = trail->fs;
+    cpargs.id = txn_id;
+    cpargs.name = SVN_PROP_REVISION_DATE;
+    date.data  = svn_time_to_cstring(apr_time_now(), trail->pool);
+    date.len = strlen(date.data);
+    cpargs.value = &date;
+    SVN_ERR(txn_body_change_txn_prop(&cpargs, trail));
+  }
+
   if (args->flags & SVN_FS_TXN_CLIENT_DATE)
     {
       struct change_txn_prop_args cpargs;
@@ -737,7 +754,6 @@ svn_fs_base__begin_txn(svn_fs_txn_t **tx
 {
   svn_fs_txn_t *txn;
   struct begin_txn_args args;
-  svn_string_t date;
 
   SVN_ERR(svn_fs__check_fs(fs, TRUE));
 
@@ -748,15 +764,7 @@ svn_fs_base__begin_txn(svn_fs_txn_t **tx
 
   *txn_p = txn;
 
-  /* Put a datestamp on the newly created txn, so we always know
-     exactly how old it is.  (This will help sysadmins identify
-     long-abandoned txns that may need to be manually removed.)  When
-     a txn is promoted to a revision, this property will be
-     automatically overwritten with a revision datestamp. */
-  date.data = svn_time_to_cstring(apr_time_now(), pool);
-  date.len = strlen(date.data);
-  return svn_fs_base__change_txn_prop(txn, SVN_PROP_REVISION_DATE,
-                                       &date, pool);
+  return SVN_NO_ERROR;
 }