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 03:08:45 UTC

svn commit: r1567494 - /subversion/trunk/subversion/tests/cmdline/checkout_tests.py

Author: breser
Date: Wed Feb 12 02:08:45 2014
New Revision: 1567494

URL: http://svn.apache.org/r1567494
Log:
Followup to r1567492, test both the exact time and near time with pegrevs

* subversion/tests/cmdline/checkout_tests.py
  (checkout_peg_rev_date): Save the output in r1_string and use that to
    run an exact test as well.

Suggested by: danielsh
(See: https://mail-archives.apache.org/mod_mbox/subversion-dev/201307.mbox/%3C20130709135210.GB4075%40lp-shahaf.local%3E)

Modified:
    subversion/trunk/subversion/tests/cmdline/checkout_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/checkout_tests.py?rev=1567494&r1=1567493&r2=1567494&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/checkout_tests.py Wed Feb 12 02:08:45 2014
@@ -668,11 +668,12 @@ def checkout_peg_rev_date(sbox):
                                                    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(output[0]).groups()))
+  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
@@ -690,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)
@@ -708,6 +709,23 @@ def checkout_peg_rev_date(sbox):
                                           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)
+
 #----------------------------------------------------------------------
 def co_with_obstructing_local_adds(sbox):
   "co handles obstructing paths scheduled for add"