summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2007-10-09 12:16:30 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2007-10-09 12:16:30 +0000
commit1a2f67af5793e0d148a90367e099c32088b412ca (patch)
treeea45e57ac33921f599cd716cafa8a178e27f66a5
parentbf0da457dc70029d92fc9741c4f4a5116c68717d (diff)
Properly resolve branches, i.e. supplying branch base revision (e.g. 1.1.1)
should resolve to latest branch revision (e.g. 1.1.1.1).
-rw-r--r--usr.bin/cvs/rcs.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index 7c5ead71592..c4bb01d752d 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.222 2007/09/24 13:44:20 joris Exp $ */
+/* $OpenBSD: rcs.c,v 1.223 2007/10/09 12:16:29 tobias Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -2576,11 +2576,14 @@ rcs_translate_tag(const char *revstr, RCSFILE *rfp)
}
/* Possibly we could be passed a version number */
- if ((frev = rcsnum_parse(revstr)) != NULL)
- return (frev);
-
- /* More likely we will be passed a symbol */
- rev = rcs_sym_getrev(rfp, revstr);
+ if ((rev = rcsnum_parse(revstr)) != NULL) {
+ /* Do not return if it is not in RCS file */
+ if ((rdp = rcs_findrev(rfp, rev)) != NULL)
+ return (rev);
+ } else {
+ /* More likely we will be passed a symbol */
+ rev = rcs_sym_getrev(rfp, revstr);
+ }
if (rev == NULL)
return (NULL);