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 2011/04/12 18:42:53 UTC
svn commit: r1091494 - in /subversion/trunk/subversion: libsvn_wc/cleanup.c
tests/cmdline/stat_tests.py
Author: philip
Date: Tue Apr 12 16:42:53 2011
New Revision: 1091494
URL: http://svn.apache.org/viewvc?rev=1091494&view=rev
Log:
Make cleanup repair timestamps for issue 3773.
* subversion/libsvn_wc/cleanup.c
(repair_timestamps): New.
(cleanup_internal): Call repair_timestamps.
* subversion/tests/cmdline/stat_tests.py
(timestamp_behaviour): Remove XFail.
Modified:
subversion/trunk/subversion/libsvn_wc/cleanup.c
subversion/trunk/subversion/tests/cmdline/stat_tests.py
Modified: subversion/trunk/subversion/libsvn_wc/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/cleanup.c?rev=1091494&r1=1091493&r2=1091494&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/cleanup.c (original)
+++ subversion/trunk/subversion/libsvn_wc/cleanup.c Tue Apr 12 16:42:53 2011
@@ -67,6 +67,69 @@ can_be_cleaned(int *wc_format,
return SVN_NO_ERROR;
}
+/* Do a modifed check for LOCAL_ABSPATH, and all working children, to force
+ timestamp repair. */
+static svn_error_t *
+repair_timestamps(svn_wc__db_t *db,
+ const char *local_abspath,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_kind_t kind;
+ svn_wc__db_status_t status;
+
+ if (cancel_func)
+ SVN_ERR(cancel_func(cancel_baton));
+
+ SVN_ERR(svn_wc__db_read_info(&status, &kind,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ db, local_abspath, scratch_pool, scratch_pool));
+
+ if (status == svn_wc__db_status_absent
+ || status == svn_wc__db_status_deleted
+ || status == svn_wc__db_status_excluded
+ || status == svn_wc__db_status_not_present)
+ return SVN_NO_ERROR;
+
+ if (kind == svn_wc__db_kind_file)
+ {
+ svn_boolean_t modified;
+ SVN_ERR(svn_wc__internal_file_modified_p(&modified, NULL, NULL,
+ db, local_abspath, FALSE, FALSE,
+ scratch_pool));
+ }
+ else if (kind == svn_wc__db_kind_dir)
+ {
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+ const apr_array_header_t *children;
+ int i;
+
+ SVN_ERR(svn_wc__db_read_children_of_working_node(&children, db,
+ local_abspath,
+ scratch_pool,
+ iterpool));
+ for (i = 0; i < children->nelts; ++i)
+ {
+ const char *child_abspath;
+
+ svn_pool_clear(iterpool);
+
+ child_abspath = svn_dirent_join(local_abspath,
+ APR_ARRAY_IDX(children, i,
+ const char *),
+ iterpool);
+
+ SVN_ERR(repair_timestamps(db, child_abspath,
+ cancel_func, cancel_baton, iterpool));
+ }
+ svn_pool_destroy(iterpool);
+ }
+
+ return SVN_NO_ERROR;
+}
/* */
static svn_error_t *
@@ -111,6 +174,9 @@ cleanup_internal(svn_wc__db_t *db,
SVN_ERR(svn_wc__db_pristine_cleanup(db, dir_abspath, scratch_pool));
}
+ SVN_ERR(repair_timestamps(db, dir_abspath, cancel_func, cancel_baton,
+ scratch_pool));
+
/* All done, toss the lock */
SVN_ERR(svn_wc__db_wclock_release(db, dir_abspath, scratch_pool));
Modified: subversion/trunk/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/stat_tests.py?rev=1091494&r1=1091493&r2=1091494&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/stat_tests.py Tue Apr 12 16:42:53 2011
@@ -691,7 +691,6 @@ def text_time_behaviour(wc_dir, wc_path,
# 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"