Author: philip
Date: Tue Apr 12 15:34:31 2011
New Revision: 1091470

URL: http://svn.apache.org/viewvc?rev=1091470&view=rev
Log:
Start making timestamp repair work in WCNG; revert now works but
not cleanup.  Issue 3773.

* subversion/libsvn_wc/questions.c
  (svn_wc__internal_file_modified_p): Repair timestamps if locked.

* subversion/tests/cmdline/stat_tests.py
  (text_time_behaviour): Check for timestamp repair by restoring code
   removed in r878620.
  (timestamp_behaviour): Mark XFail and issue 3773.

Modified:
    subversion/trunk/subversion/libsvn_wc/questions.c
    subversion/trunk/subversion/tests/cmdline/stat_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/questions.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/questions.c?rev=1091470&r1=1091469&r2=1091470&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/questions.c (original)
+++ subversion/trunk/subversion/libsvn_wc/questions.c Tue Apr 12 15:34:31 2011
@@ -378,11 +378,26 @@ svn_wc__internal_file_modified_p(svn_boo
     }
 
   /* Check all bytes, and verify checksum if requested. */
-  return svn_error_return(compare_and_verify(modified_p, db, local_abspath,
-                                             pristine_stream,
-                                             compare_textbases,
-                                             force_comparison,
-                                             scratch_pool));
+  SVN_ERR(compare_and_verify(modified_p, db, local_abspath,
+                             pristine_stream,
+                             compare_textbases,
+                             force_comparison,
+                             scratch_pool));
+
+  if (!*modified_p)
+    {
+      svn_boolean_t own_lock;
+
+      /* The timestamp is missing or "broken" so "repair" it if we can. */
+      SVN_ERR(svn_wc__db_wclock_owns_lock(&own_lock, db, local_abspath, FALSE,
+                                          scratch_pool));
+      if (own_lock)
+        SVN_ERR(svn_wc__db_global_record_fileinfo(db, local_abspath,
+                                                  finfo.size, finfo.mtime,
+                                                  scratch_pool));
+    }
+
+  return SVN_NO_ERROR;
 }
 
 

Modified: subversion/trunk/subversion/tests/cmdline/stat_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/stat_tests.py?rev=1091470&r1=1091469&r2=1091470&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/stat_tests.py Tue Apr 12 15:34:31 
2011
@@ -679,9 +679,20 @@ def text_time_behaviour(wc_dir, wc_path,
   if text_time != pre_text_time:
     raise svntest.Failure
 
+  # revert/cleanup change the text-time even though the text doesn't change
+  if cmd == 'cleanup':
+    svntest.actions.run_and_verify_svn(None, None, [], cmd, wc_dir)
+  else:
+    svntest.actions.run_and_verify_svn(None, None, [], cmd, wc_path)
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+  text_time = get_text_timestamp(wc_path)
+  if text_time == pre_text_time:
+    raise svntest.Failure
 
 # Is this really a status test?  I'm not sure, but I don't know where
 # else to put it.
+@XFail()
+@Issue(3773)
 def timestamp_behaviour(sbox):
   "timestamp behaviour"
 


Reply via email to