cvsserver t9400: add basic 'cvs log' test

'cvs log' output is arguably deficient in a number of ways (see the comment added with the test), but add a test for the current output to detect for accidental regressions. Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Matthew Ogilvie committed Oct 13, 2012 at 23:42 UTC ef6fd72b6ce18b5be694f39b37d30d4cdc6bfd2a
1 file changed +70
t/t9400-git-cvsserver-server.sh
+70
@@ -504,6 +504,76 @@ test_expect_success 'cvs co -c (shows module database)' '
504 ! grep -v "^master[ ][ ]*master$" <out
505 '
506
507 +#------------
508 +# CVS LOG
509 +#------------
510 +
511 +# Known issues with git-cvsserver current log output:
512 +# - Hard coded "lines: +2 -3" placeholder, instead of real numbers.
513 +# - CVS normally does not internally add a blank first line
514 +# nor a last line with nothing but a space to log messages.
515 +# - The latest cvs 1.12.x server sends +0000 timezone (with some hidden "MT"
516 +# tagging in the protocol), and if cvs 1.12.x client sees the MT tags,
517 +# it converts to local time zone. git-cvsserver doesn't do the +0000
518 +# or the MT tags...
519 +# - The latest 1.12.x releases add a "commitid:" field on to the end of the
520 +# "date:" line (after "lines:"). Maybe we could stick git's commit id
521 +# in it? Or does CVS expect a certain number of bits (too few for
522 +# a full sha1)?
523 +#
524 +# Given the above, expect the following test to break if git-cvsserver's
525 +# log output is improved. The test is just to ensure it doesn't
526 +# accidentally get worse.
527 +
528 +sed -e 's/^x//' -e 's/SP$/ /' > "$WORKDIR/expect" <<EOF
529 +x
530 +xRCS file: $WORKDIR/gitcvs.git/master/merge,v
531 +xWorking file: merge
532 +xhead: 1.4
533 +xbranch:
534 +xlocks: strict
535 +xaccess list:
536 +xsymbolic names:
537 +xkeyword substitution: kv
538 +xtotal revisions: 4; selected revisions: 4
539 +xdescription:
540 +x----------------------------
541 +xrevision 1.4
542 +xdate: __DATE__; author: author; state: Exp; lines: +2 -3
543 +x
544 +xMerge test (no-op)
545 +xSP
546 +x----------------------------
547 +xrevision 1.3
548 +xdate: __DATE__; author: author; state: Exp; lines: +2 -3
549 +x
550 +xMerge test (conflict)
551 +xSP
552 +x----------------------------
553 +xrevision 1.2
554 +xdate: __DATE__; author: author; state: Exp; lines: +2 -3
555 +x
556 +xMerge test (merge)
557 +xSP
558 +x----------------------------
559 +xrevision 1.1
560 +xdate: __DATE__; author: author; state: Exp; lines: +2 -3
561 +x
562 +xMerge test (pre-merge)
563 +xSP
564 +x=============================================================================
565 +EOF
566 +expectStat="$?"
567 +
568 +cd "$WORKDIR"
569 +test_expect_success 'cvs log' '
570 + cd cvswork &&
571 + test x"$expectStat" = x"0" &&
572 + GIT_CONFIG="$git_config" cvs log merge >../out &&
573 + sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual &&
574 + test_cmp ../expect ../actual
575 +'
576 +
577 #------------
578 # CVS ANNOTATE
579 #------------