summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2008-02-20 09:19:05 +0000
committerJoris Vink <joris@cvs.openbsd.org>2008-02-20 09:19:05 +0000
commit056a7a367bdf9aaa483176042fc1cd61c544b508 (patch)
treef8b09e28a6a7cc97036a2894f6d15c6cb8b088be
parent7732728bc3c7a1fa6ba37ce0156a80951b182eac (diff)
make sure we use the default branch (if available)
in rcs_translate_tag() if we are looking for a revision on the trunk. fixes inconsistancy with gnu cvs. problem noticed by brad@
-rw-r--r--usr.bin/cvs/rcs.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index c7d5114ef54..99dee560a96 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.249 2008/02/11 20:33:11 tobias Exp $ */
+/* $OpenBSD: rcs.c,v 1.250 2008/02/20 09:19:04 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -3525,13 +3525,20 @@ RCSNUM *
rcs_translate_tag(const char *revstr, RCSFILE *rfp)
{
int follow;
+ char branch[CVS_REV_BUFSZ];
RCSNUM *brev, *frev, *rev;
struct rcs_delta *rdp, *trdp;
brev = frev = NULL;
- if (revstr == NULL)
- revstr = RCS_HEAD_BRANCH;
+ if (revstr == NULL) {
+ if (rfp->rf_branch != NULL) {
+ rcsnum_tostr(rfp->rf_branch, branch, sizeof(branch));
+ revstr = branch;
+ } else {
+ revstr = RCS_HEAD_BRANCH;
+ }
+ }
if ((rev = rcs_get_revision(revstr, rfp)) == NULL)
return NULL;