[[[

* subversion-1.1.1.orig/subversion/include/svn_props.h
  Definition of svn:text-time-property

* subversion-1.1.1.orig/subversion/libsvn_client/commit.c
  (import_file) If the svn:text-time property has been set via autoprops,
     set the value to the correct value

* subversion-1.1.1.orig/subversion/libsvn_client/commit_util.c
  (harvest_committables) If the text has been modified AND 
     the modification time should be recorded, 
     there's an property modification too.
     Set the SVN_CLIENT_COMMIT_ITEM_TEXT_MODS bit.

* subversion-1.1.1.orig/subversion/libsvn_client/export.c
  (copy_versioned_files) Fetch and save the svn:text-time property
  (change_file_prop) and use it to override the commit-timestamp

* subversion-1.1.1.orig/subversion/libsvn_client/repos_diff.c
  (change_file_prop) Use the files' current mtime instead of the
     saved property on diffing

* subversion-1.1.1.orig/subversion/libsvn_wc/adm_crawler.c
  (restore_file) 
* subversion-1.1.1.orig/subversion/libsvn_wc/adm_ops.c
  (revert_admin_things)
* subversion-1.1.1.orig/subversion/libsvn_wc/update_editor.c
  (change_file_prop)
  Use the svn:text-time to override the commit-time

]]]


diff -upwr subversion-1.1.1.orig/subversion/include/svn_props.h subversion-1.1.1/subversion/include/svn_props.h
--- subversion-1.1.1.orig/subversion/include/svn_props.h	2004-11-08 09:56:03.000000000 +0100
+++ subversion-1.1.1/subversion/include/svn_props.h	2004-10-27 16:07:21.000000000 +0200
@@ -188,6 +188,9 @@ svn_error_t *svn_prop_diffs (apr_array_h
 /** The value to force the special property to when set. */
 #define SVN_PROP_SPECIAL_VALUE "*"
 
+/** The files' last modification time */
+#define SVN_PROP_TEXT_TIME  SVN_PROP_PREFIX "text-time"
+
 /** Describes external items to check out into this directory. 
  *
  * The format is a series of lines, such as:
diff -upwr subversion-1.1.1.orig/subversion/libsvn_client/commit.c subversion-1.1.1/subversion/libsvn_client/commit.c
--- subversion-1.1.1.orig/subversion/libsvn_client/commit.c	2004-11-08 09:56:03.000000000 +0100
+++ subversion-1.1.1/subversion/libsvn_client/commit.c	2004-11-08 09:59:26.000000000 +0100
@@ -199,6 +199,20 @@ import_file (const svn_delta_editor_t *e
           void *pval;
 
           apr_hash_this (hi, &pname, NULL, &pval);
+
+          /* if the svn:text-time property is set, use the current file
+           * date instead of the value */
+          if (strcmp (pname, SVN_PROP_TEXT_TIME) == 0)
+            {
+              apr_time_t mtime;
+
+              SVN_ERR (svn_io_file_affected_time (&mtime, path, pool) );
+              pval=svn_string_create( 
+                                     svn_time_to_cstring (mtime, pool),
+                                     pool );
+            }
+
+
           SVN_ERR (editor->change_file_prop (file_baton, pname, pval, pool));
         }
     }
diff -upwr subversion-1.1.1.orig/subversion/libsvn_client/commit_util.c subversion-1.1.1/subversion/libsvn_client/commit_util.c
--- subversion-1.1.1.orig/subversion/libsvn_client/commit_util.c	2004-11-08 09:56:03.000000000 +0100
+++ subversion-1.1.1/subversion/libsvn_client/commit_util.c	2004-11-08 09:59:49.000000000 +0100
@@ -413,7 +413,28 @@ harvest_committables (apr_hash_t *commit
 
   /* Set text/prop modification flags accordingly. */
   if (text_mod)
+    {
     state_flags |= SVN_CLIENT_COMMIT_ITEM_TEXT_MODS;
+
+      SVN_ERR (svn_wc_prop_get (&propval, SVN_PROP_TEXT_TIME, path, adm_access,
+                                pool));
+      /* If the text has been modified AND the modification time
+       * should be recorded, there's an property modification too. */
+      if (propval)
+        {
+          apr_time_t mtime;
+
+          SVN_ERR (svn_io_file_affected_time (&mtime, path, pool) );
+          propval=svn_string_create( 
+                                    svn_time_to_cstring (mtime, pool),
+                                    pool );
+          SVN_ERR (svn_wc_prop_set (SVN_PROP_TEXT_TIME, 
+                                    propval, path, adm_access, pool) );
+          state_flags |= SVN_CLIENT_COMMIT_ITEM_PROP_MODS;
+        }
+
+    }
+
   if (prop_mod)
     state_flags |= SVN_CLIENT_COMMIT_ITEM_PROP_MODS;
 
diff -upwr subversion-1.1.1.orig/subversion/libsvn_client/export.c subversion-1.1.1/subversion/libsvn_client/export.c
--- subversion-1.1.1.orig/subversion/libsvn_client/export.c	2004-11-08 09:56:03.000000000 +0100
+++ subversion-1.1.1/subversion/libsvn_client/export.c	2004-11-08 10:01:08.000000000 +0100
@@ -194,7 +194,7 @@ copy_versioned_files (const char *from,
           svn_subst_eol_style_t style;
           apr_hash_t *props;
           const char *base;
-          svn_string_t *eol_style, *keywords, *executable, *externals, *special;
+          svn_string_t *eol_style, *keywords, *executable, *externals, *special, *text_time;
           const char *eol = NULL;
           svn_boolean_t local_mod = FALSE;
           apr_time_t tm;
@@ -244,6 +244,8 @@ copy_versioned_files (const char *from,
                                     APR_HASH_KEY_STRING);
           special = apr_hash_get (props, SVN_PROP_SPECIAL,
                                   APR_HASH_KEY_STRING);
+          text_time = apr_hash_get (props, SVN_PROP_TEXT_TIME,
+                                    APR_HASH_KEY_STRING);
           
           if (eol_style)
             SVN_ERR (get_eol_style (&style, &eol, eol_style->data, native_eol));
@@ -257,6 +259,9 @@ copy_versioned_files (const char *from,
           else
             {
               tm = entry->cmt_date;
+
+              if (text_time)
+                SVN_ERR(svn_time_from_cstring (&tm, text_time->data, iterpool));
             }
 
           if (keywords)
@@ -400,6 +405,7 @@ struct file_baton
   const char *url;
   const char *author;
   apr_time_t date;
+  svn_boolean_t date_is_mtime;
 
   /* Pool associated with this baton. */
   apr_pool_t *pool;
@@ -589,11 +595,21 @@ change_file_prop (void *file_baton,
   else if (strcmp (name, SVN_PROP_EXECUTABLE) == 0)
     fb->executable_val = svn_string_dup (value, fb->pool);
 
+  /* if we have a specific text-time for this file, it overrides
+   * the commit-timestamp */
+  else if (strcmp (name, SVN_PROP_TEXT_TIME) == 0)
+    {
+      fb->date_is_mtime=TRUE;
+      SVN_ERR (svn_time_from_cstring (&fb->date, value->data, fb->pool));
+    }
+
   /* Try to fill out the baton's keywords-structure too. */
   else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
     fb->revision = apr_pstrdup (fb->pool, value->data);
 
   else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
+    /* do not overwrite timestamp */
+    if (!fb->date_is_mtime)
       SVN_ERR (svn_time_from_cstring (&fb->date, value->data, fb->pool));
 
   else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
diff -upwr subversion-1.1.1.orig/subversion/libsvn_client/repos_diff.c subversion-1.1.1/subversion/libsvn_client/repos_diff.c
--- subversion-1.1.1.orig/subversion/libsvn_client/repos_diff.c	2004-11-08 09:56:03.000000000 +0100
+++ subversion-1.1.1/subversion/libsvn_client/repos_diff.c	2004-11-08 10:01:49.000000000 +0100
@@ -914,7 +914,22 @@ change_file_prop (void *file_baton,
 
   propchange = apr_array_push (b->propchanges);
   propchange->name = apr_pstrdup (b->pool, name);
+
+  /* if the svn:text-time property is set, use the current file
+   * date instead of the value */
+  if (strcmp (name, SVN_PROP_TEXT_TIME) == 0)
+    {
+      apr_time_t mtime;
+
+      SVN_ERR (svn_io_file_affected_time (&mtime, b->path, b->pool) );
+      propchange->value=svn_string_create( 
+                                          svn_time_to_cstring (mtime, b->pool),
+                                          b->pool );
+    }
+  else
+    {
   propchange->value = value ? svn_string_dup (value, b->pool) : NULL;
+    }
   
   return SVN_NO_ERROR;
 }
diff -upwr subversion-1.1.1.orig/subversion/libsvn_wc/adm_crawler.c subversion-1.1.1/subversion/libsvn_wc/adm_crawler.c
--- subversion-1.1.1.orig/subversion/libsvn_wc/adm_crawler.c	2004-11-08 09:56:03.000000000 +0100
+++ subversion-1.1.1/subversion/libsvn_wc/adm_crawler.c	2004-11-08 10:02:30.000000000 +0100
@@ -108,12 +108,23 @@ restore_file (const char *file_path,
   SVN_ERR (svn_wc_entry (&entry, file_path, adm_access, FALSE, pool));
   assert(entry != NULL);
 
-  /* Possibly set timestamp to last-commit-time. */
+  /* Possibly set timestamp to last-commit-time or, if defined,
+   * the last modification-time. */
   if (use_commit_times && (! special))
     {
-      SVN_ERR (svn_io_set_file_affected_time (entry->cmt_date,
-                                              file_path, pool));
+      const svn_string_t *mtime;
+
+      SVN_ERR (svn_wc_prop_get (&mtime, SVN_PROP_TEXT_TIME, 
+                                file_path, adm_access, pool));
+
+      if (mtime)
+        SVN_ERR (svn_time_from_cstring (&tstamp, mtime->data, pool));
+      else
       tstamp = entry->cmt_date;
+
+
+      SVN_ERR (svn_io_set_file_affected_time (tstamp,
+                                              file_path, pool));
     }
   else
     {
diff -upwr subversion-1.1.1.orig/subversion/libsvn_wc/adm_ops.c subversion-1.1.1/subversion/libsvn_wc/adm_ops.c
--- subversion-1.1.1.orig/subversion/libsvn_wc/adm_ops.c	2004-11-08 09:56:03.000000000 +0100
+++ subversion-1.1.1/subversion/libsvn_wc/adm_ops.c	2004-11-08 10:03:01.000000000 +0100
@@ -1302,7 +1302,16 @@ revert_admin_things (svn_wc_adm_access_t
              than the 'now' time that already exists. */
           if (use_commit_times && (! special))
             {
-              SVN_ERR (svn_io_set_file_affected_time (entry->cmt_date,
+              const svn_string_t *mtime;
+
+              SVN_ERR (svn_wc_prop_get (&mtime, SVN_PROP_TEXT_TIME, 
+                                        fullpath, adm_access, pool));
+
+              tstamp = entry->cmt_date;
+              if (mtime)
+                svn_time_from_cstring ( &tstamp, mtime->data, pool);
+
+              SVN_ERR (svn_io_set_file_affected_time (tstamp,
                                                       fullpath, pool));
               tstamp = entry->cmt_date;
             }
diff -upwr subversion-1.1.1.orig/subversion/libsvn_wc/update_editor.c subversion-1.1.1/subversion/libsvn_wc/update_editor.c
--- subversion-1.1.1.orig/subversion/libsvn_wc/update_editor.c	2004-11-08 09:56:03.000000000 +0100
+++ subversion-1.1.1/subversion/libsvn_wc/update_editor.c	2004-11-08 10:03:23.000000000 +0100
@@ -524,6 +524,7 @@ struct file_baton
      that comes through as an 'entry prop', and will be used to set
      the working file's timestamp if it's added.  */
   const char *last_changed_date;
+  svn_boolean_t last_changed_is_for_entry;
 
   /* Bump information for the directory this file lives in */
   struct bump_dir_info *bump_info;
@@ -1684,9 +1685,17 @@ change_file_prop (void *file_baton,
 
   /* Special case: if the file is added during a checkout, cache the
      last-changed-date propval for future use. */
-  if (eb->use_commit_times
-      && (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0))
+  if (eb->use_commit_times)
+    {
+      if ( (strcmp (name, SVN_PROP_TEXT_TIME) == 0) )
+        {
     fb->last_changed_date = apr_pstrdup (fb->pool, value->data);
+          fb->last_changed_is_for_entry = 1;
+        }
+      if ( (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0) &&
+           !fb->last_changed_is_for_entry)
+        fb->last_changed_date = apr_pstrdup (fb->pool, value->data);
+    }
 
   return SVN_NO_ERROR;
 }

