You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2014/06/25 21:32:34 UTC
svn commit: r1605567 - in /subversion/branches/1.7.x: ./ STATUS
subversion/tests/cmdline/checkout_tests.py
Author: svn-role
Date: Wed Jun 25 19:32:34 2014
New Revision: 1605567
URL: http://svn.apache.org/r1605567
Log:
Merge the r1496127 group from trunk:
* r1496127, r1567492, r1567494
Fix occasional failure of checkout_tests.py 12 due to dropping the
fractional seconds from the current time.
Justification:
Spurious FAILs confuse people testing the release.
This group was back-ported to 1.8.x in http://svn.apache.org/r1567731 .
Votes:
+1: julianfoad, danielsh, rhuijben
Modified:
subversion/branches/1.7.x/ (props changed)
subversion/branches/1.7.x/STATUS
subversion/branches/1.7.x/subversion/tests/cmdline/checkout_tests.py
Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1496127,1567492,1567494
Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1605567&r1=1605566&r2=1605567&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Jun 25 19:32:34 2014
@@ -167,12 +167,3 @@ Veto-blocked changes:
Approved changes:
=================
-
- * r1496127, r1567492, r1567494
- Fix occasional failure of checkout_tests.py 12 due to dropping the
- fractional seconds from the current time.
- Justification:
- Spurious FAILs confuse people testing the release.
- This group was back-ported to 1.8.x in http://svn.apache.org/r1567731 .
- Votes:
- +1: julianfoad, danielsh, rhuijben
Modified: subversion/branches/1.7.x/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/tests/cmdline/checkout_tests.py?rev=1605567&r1=1605566&r2=1605567&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/branches/1.7.x/subversion/tests/cmdline/checkout_tests.py Wed Jun 25 19:32:34 2014
@@ -27,6 +27,7 @@
# General modules
import sys, re, os, time, subprocess
+import datetime
# Our testing module
import svntest
@@ -658,11 +659,28 @@ def checkout_peg_rev_date(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- # note the current time to use it as peg revision date.
- current_time = time.strftime("%Y-%m-%dT%H:%M:%S")
-
- # sleep till the next second.
- time.sleep(1.1)
+ ## Get svn:date.
+ exit_code, output, errput = svntest.main.run_svn(None, 'propget', 'svn:date',
+ '--revprop', '-r1',
+ '--strict',
+ sbox.repo_url)
+ if exit_code or errput != [] or len(output) != 1:
+ raise svntest.Failure("svn:date propget failed")
+ r1_string = output[0]
+
+ ## Increment the svn:date date by one microsecond.
+ # TODO: pass tzinfo=UTC to datetime.datetime()
+ date_pattern = re.compile(r'(\d+)-(\d+)-(\d+)T(\d\d):(\d\d):(\d\d)\.(\d+)Z$')
+ r1_time = datetime.datetime(*map(int, date_pattern.match(r1_string).groups()))
+ peg_time = r1_time + datetime.timedelta(microseconds=1)
+ assert r1_time != peg_time
+ # peg_string is, by all likelihood, younger than r1's svn:date and older than
+ # r2's svn:date. It is also not equal to either of them, so we test the
+ # binary search of svn:date values.
+ peg_string = '%04d-%02d-%02dT%02d:%02d:%02d.%06dZ' % \
+ tuple(getattr(peg_time, x)
+ for x in ["year", "month", "day", "hour", "minute",
+ "second", "microsecond"])
# create a new revision
mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -671,7 +689,7 @@ def checkout_peg_rev_date(sbox):
svntest.actions.run_and_verify_svn(None, None, [],
'ci', '-m', 'changed file mu', wc_dir)
- # now checkout the repo@current_time in another folder, this should create our
+ # now checkout the repo@peg_string in another folder, this should create our
# initial wc without the change in mu.
checkout_target = sbox.add_wc_path('checkout')
os.mkdir(checkout_target)
@@ -684,7 +702,24 @@ def checkout_peg_rev_date(sbox):
# use an old date to checkout, that way we're sure we get the first revision
svntest.actions.run_and_verify_checkout(sbox.repo_url +
- '@{' + current_time + '}',
+ '@{' + peg_string + '}',
+ checkout_target,
+ expected_output,
+ expected_wc)
+
+ # now try another checkout with repo@r1_string
+ checkout_target = sbox.add_wc_path('checkout2')
+ os.mkdir(checkout_target)
+
+ expected_output = svntest.main.greek_state.copy()
+ expected_output.wc_dir = checkout_target
+ expected_output.tweak(status='A ', contents=None)
+
+ expected_wc = svntest.main.greek_state.copy()
+
+ # use an old date to checkout, that way we're sure we get the first revision
+ svntest.actions.run_and_verify_checkout(sbox.repo_url +
+ '@{' + r1_string + '}',
checkout_target,
expected_output,
expected_wc)