summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2008-02-01 13:36:44 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2008-02-01 13:36:44 +0000
commit188c53eb8b603b04e09d6a50cde302943b84ff34 (patch)
treea4c3311d35c228348f89d462a922459ac8c945ea
parent7347fcb37d15cbf0548b19777be84bc78883bff0 (diff)
Another GNU cvs weirdo: During annotate, invalid revisions are allowed if
-f is supplied (thus switching to HEAD), but unknown symbols end in fatal.
-rw-r--r--regress/usr.bin/cvs/Makefile4
-rw-r--r--usr.bin/cvs/annotate.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/regress/usr.bin/cvs/Makefile b/regress/usr.bin/cvs/Makefile
index fb350e7df59..422cfed5142 100644
--- a/regress/usr.bin/cvs/Makefile
+++ b/regress/usr.bin/cvs/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.14 2008/01/31 21:00:16 tobias Exp $
+# $OpenBSD: Makefile,v 1.15 2008/02/01 13:36:43 tobias Exp $
# Regression tests by Niall O'Higgins <niallo@openbsd.org> and
# Tobias Stoeckmann <tobias@openbsd.org>.
@@ -33,6 +33,7 @@ LTESTS= cvs-initial \
cvs-annotate \
cvs-annotate-rflag-inval_branch_rev \
cvs-annotate-rflag-inval_branch_rev-fflag \
+ cvs-annotate-rflag-unknown_symbol-fflag \
cvs-checkout-rflag-1.1 \
cvs-update-Aflag \
cvs-status \
@@ -47,7 +48,6 @@ LTESTS= cvs-initial \
# cvs-checkout-dflag
# cvs-update-for_subdir
# Known to behave unconform to GNU cvs.
-# cvs-annotate-rflag-unknown_symbol-fflag
# cvs-diff-file
.for t in ${LTESTS}
diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c
index 9d47c272ae9..bc878f7ec18 100644
--- a/usr.bin/cvs/annotate.c
+++ b/usr.bin/cvs/annotate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: annotate.c,v 1.45 2008/01/31 10:15:05 tobias Exp $ */
+/* $OpenBSD: annotate.c,v 1.46 2008/02/01 13:36:43 tobias Exp $ */
/*
* Copyright (c) 2007 Tobias Stoeckmann <tobias@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -137,6 +137,12 @@ cvs_annotate_local(struct cvs_file *cf)
/* Stick at weird GNU cvs, ignore error. */
return;
+ /* -f is not allowed for unknown symbols */
+ rev = rcsnum_parse(cvs_specified_tag);
+ if (rev == NULL)
+ fatal("no such tag %s", cvs_specified_tag);
+
+ rcsnum_free(rev);
rev = rcsnum_alloc();
rcsnum_cpy(cf->file_rcs->rf_head, rev, 0);
}