summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/rcs.c22
-rw-r--r--usr.bin/cvs/rcs.h3
2 files changed, 23 insertions, 2 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index 0efff87219f..39663f425b0 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.175 2006/05/28 10:14:59 joris Exp $ */
+/* $OpenBSD: rcs.c,v 1.176 2006/05/29 07:15:52 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -798,6 +798,12 @@ rcs_sym_getrev(RCSFILE *file, const char *sym)
return (NULL);
}
+ if (!strcmp(sym, RCS_HEAD_BRANCH)) {
+ num = rcsnum_alloc();
+ rcsnum_cpy(file->rf_head, num, 0);
+ return (num);
+ }
+
num = NULL;
TAILQ_FOREACH(symp, &(file->rf_symbols), rs_list)
if (strcmp(symp->rs_name, sym) == 0)
@@ -2957,3 +2963,17 @@ rcs_kwexp_buf(BUF *bp, RCSFILE *rf, RCSNUM *rev)
}
return (bp);
}
+
+RCSNUM *
+rcs_translate_tag(const char *revstr, RCSFILE *rfp)
+{
+ RCSNUM *rev;
+
+ rev = rcs_sym_getrev(rfp, revstr);
+ if (rev == NULL) {
+ if ((rev = rcsnum_parse(revstr)) == NULL)
+ fatal("%s is an invalid revision/symbol", revstr);
+ }
+
+ return (rev);
+}
diff --git a/usr.bin/cvs/rcs.h b/usr.bin/cvs/rcs.h
index 12d0cce7d96..f6926a6f2c9 100644
--- a/usr.bin/cvs/rcs.h
+++ b/usr.bin/cvs/rcs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.h,v 1.64 2006/05/28 10:14:59 joris Exp $ */
+/* $OpenBSD: rcs.h,v 1.65 2006/05/29 07:15:52 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -229,6 +229,7 @@ struct rcs_delta *rcs_findrev(RCSFILE *, RCSNUM *);
int rcs_sym_add(RCSFILE *, const char *, RCSNUM *);
int rcs_sym_remove(RCSFILE *, const char *);
RCSNUM *rcs_sym_getrev(RCSFILE *, const char *);
+RCSNUM *rcs_translate_tag(const char *, RCSFILE *);
int rcs_sym_check(const char *);
int rcs_lock_getmode(RCSFILE *);
int rcs_lock_setmode(RCSFILE *, int);