You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/02/12 20:29:44 UTC

svn commit: r1567731 - in /subversion/branches/1.8.x: ./ STATUS subversion/tests/cmdline/checkout_tests.py

Author: breser
Date: Wed Feb 12 19:29:44 2014
New Revision: 1567731

URL: http://svn.apache.org/r1567731
Log:
Merge the r1496127 group from trunk:

 * r1496127, r1567492, r1567494
   Fix occasional failure of checkout_tests.py 12.
   Justification:
     Spurious FAILs confuse people testing the release.
   Votes:
     +1: breser, danielsh, rhuijben
     +1: philip (without r1567492, r1567494)

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/tests/cmdline/checkout_tests.py

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1496127,1567492,1567494

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1567731&r1=1567730&r2=1567731&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed Feb 12 19:29:44 2014
@@ -190,14 +190,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1496127, r1567492, r1567494
-   Fix occasional failure of checkout_tests.py 12.
-   Justification:
-     Spurious FAILs confuse people testing the release.
-   Votes:
-     +1: breser, danielsh, rhuijben
-     +1: philip (without r1567492, r1567494)
-
  * r1567286, r1567392
    Disable SQLITE_ENABLE_STAT3/4 with versions of SQLite that are buggy.
    Justification:

Modified: subversion/branches/1.8.x/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/checkout_tests.py?rev=1567731&r1=1567730&r2=1567731&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/checkout_tests.py Wed Feb 12 19:29:44 2014
@@ -27,6 +27,7 @@
 
 # General modules
 import sys, re, os, time, subprocess
+import datetime
 
 # Our testing module
 import svntest
@@ -660,11 +661,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')
@@ -673,7 +691,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)
@@ -686,7 +704,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)