Author: julianfoad
Date: Thu Apr 4 21:14:06 2013
New Revision: 1464769
URL: http://svn.apache.org/r1464769
Log:
Sleep for timestamps even if using commit times as timestamps.
Before r1463721, 'revert' did not sleep if using commit times, while
'checkout' and 'update' and 'switch' would sleep regardless. r1463721 made
all of those operations omit the sleep if using commit times, but Philip and
Ben discussed and pointed out that the commit time could still be within the
timestamp resolution and so that could be unsafe. Therefore we will sleep
anyway, in all of those operations, to be safe.
(The commit time could also be *after* the local time because of clock skew,
which adds the possibility that the sleep takes us *into* an unsafe time
period, but we're not trying to address that problem here.)
Found by: breser
* subversion/libsvn_client/revert.c
(svn_client_revert2): Sleep regardless of use-commit-times.
* subversion/libsvn_client/switch.c
(switch_internal): Sleep regardless of use-commit-times.
* subversion/libsvn_client/update.c
(update_internal): Sleep regardless of use-commit-times. (Checkout also
uses this code.)
Modified:
subversion/trunk/subversion/libsvn_client/revert.c
subversion/trunk/subversion/libsvn_client/switch.c
subversion/trunk/subversion/libsvn_client/update.c
Modified: subversion/trunk/subversion/libsvn_client/revert.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/revert.c?rev=1464769&r1=1464768&r2=1464769&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/revert.c (original)
+++ subversion/trunk/subversion/libsvn_client/revert.c Thu Apr 4 21:14:06 2013
@@ -183,18 +183,17 @@ svn_client_revert2(const apr_array_heade
errorful:
- if (!use_commit_times)
- {
- /* Sleep to ensure timestamp integrity. */
- const char* sleep_path = NULL;
-
- /* Only specify a path if we are certain all paths are on the
- same filesystem */
- if (paths->nelts == 1)
- sleep_path = APR_ARRAY_IDX(paths, 0, const char *);
+ {
+ /* Sleep to ensure timestamp integrity. */
+ const char *sleep_path = NULL;
+
+ /* Only specify a path if we are certain all paths are on the
+ same filesystem */
+ if (paths->nelts == 1)
+ sleep_path = APR_ARRAY_IDX(paths, 0, const char *);
- svn_io_sleep_for_timestamps(sleep_path, subpool);
- }
+ svn_io_sleep_for_timestamps(sleep_path, subpool);
+ }
svn_pool_destroy(subpool);
Modified: subversion/trunk/subversion/libsvn_client/switch.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/switch.c?rev=1464769&r1=1464768&r2=1464769&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/switch.c (original)
+++ subversion/trunk/subversion/libsvn_client/switch.c Thu Apr 4 21:14:06 2013
@@ -337,8 +337,7 @@ switch_internal(svn_revnum_t *result_rev
/* Past this point, we assume the WC is going to be modified so we will
* need to sleep for timestamps. */
- if (! use_commit_times)
- *timestamp_sleep = TRUE;
+ *timestamp_sleep = TRUE;
/* Drive the reporter structure, describing the revisions within
PATH. When we call reporter->finish_report, the update_editor
Modified: subversion/trunk/subversion/libsvn_client/update.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1464769&r1=1464768&r2=1464769&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/update.c (original)
+++ subversion/trunk/subversion/libsvn_client/update.c Thu Apr 4 21:14:06 2013
@@ -449,8 +449,7 @@ update_internal(svn_revnum_t *result_rev
/* Past this point, we assume the WC is going to be modified so we will
* need to sleep for timestamps. */
- if (! use_commit_times)
- *timestamp_sleep = TRUE;
+ *timestamp_sleep = TRUE;
/* Drive the reporter structure, describing the revisions within
PATH. When we call reporter->finish_report, the