diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-11-08 20:37:41 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-11-08 20:37:41 +0000 |
commit | cf2bfc595b3f2d1d299f37bfc55a8f6553c92e07 (patch) | |
tree | cbe6423c326fd60da772def277f002692f928dba /usr.bin/cvs | |
parent | 1ed8089e5e0f649aa03fc68755b50eb71165c653 (diff) |
Return latest revision of default branch when HEAD is requested and no
newer revisions are available (for example multiple imports).
Reported by ckuethe@, OK niallo@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/rcs.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index c93eea9c11f..5b38e0498e7 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.225 2007/10/09 12:59:53 tobias Exp $ */ +/* $OpenBSD: rcs.c,v 1.226 2007/11/08 20:37:40 tobias Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -553,7 +553,15 @@ rcs_head_get(RCSFILE *file) break; } rcsnum_free(rootrev); - rcsnum_cpy(brp->rb_num, rev, 0); + + if ((rdp = rcs_findrev(file, brp->rb_num)) == NULL) + fatal("rcs_head_get: could not find branch revision"); + while (rdp->rd_next->rn_len != 0) + if ((rdp = rcs_findrev(file, rdp->rd_next)) == NULL) + fatal("rcs_head_get: could not find " + "next branch revision"); + + rcsnum_cpy(rdp->rd_num, rev, 0); } else { rcsnum_cpy(file->rf_head, rev, 0); } |