From: Eric S. Raymond Date: Fri, 7 Nov 2014 22:19:08 +0000 (-0500) Subject: Properly regression-test checkout. X-Git-Tag: 0.2~37 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=0753142327ce3e5287a64086a2b68337ed5e16e8;p=src.git Properly regression-test checkout. --- diff --git a/src b/src index cb30500..b74fb79 100755 --- a/src +++ b/src @@ -465,7 +465,7 @@ def log_method(*args): def checkout_method(*args): "Refresh the working copy from the history file." (revspec, args) = preamble("checkout", args) - if revspec and len(revspec) > 1: + if revspec and revspec[0] != revspec[1]: croak("checkout needs an empty or singleton revision spec") for arg in args: master = RCSLog(arg) diff --git a/srctest b/srctest index d9c4571..a6c843a 100755 --- a/srctest +++ b/srctest @@ -25,6 +25,7 @@ check "smoke test" cat >testfile1 </dev/null check "add" @@ -39,6 +40,7 @@ cat >testfile1 </dev/null check "commit with -" @@ -75,6 +77,7 @@ Now is the time for all good men to come to the aid of foo EOF +cp testfile1 testrev3 echo "Third comment" >testfile4 src $TESTOPTS commit -f testfile4 testfile1 >/dev/null @@ -106,6 +109,14 @@ src $TESTOPTS list 5 testfile1 >testfile7 2>&1 diff testfile6 testfile7 check "oob revision spec check" -# to do: checkout, tag, fast-export +for rev in 1 2 3 +do + src $TESTOPTS checkout $rev testfile1 >/dev/null + check "revision $rev checkout test" + diff -u testrev${rev} testfile1 + check "revision $rev content test" +done + +# to do: tag, fast-export # end