summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/rcs.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2008-06-15 04:38:53 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2008-06-15 04:38:53 +0000
commit90079a6cb96f7f6e3fe7deb6e70c4909eaeb23c0 (patch)
treec455a71ff96e0c44015d9b22092ec8a860ddfb7e /usr.bin/cvs/rcs.c
parent2dedb0169f579fa1ad8e7a60732afdbb01581df6 (diff)
Support the addition of new files in branches.
ok joris
Diffstat (limited to 'usr.bin/cvs/rcs.c')
-rw-r--r--usr.bin/cvs/rcs.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index 0cb8a0fa67a..0d022e8ed62 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.275 2008/06/14 04:34:08 tobias Exp $ */
+/* $OpenBSD: rcs.c,v 1.276 2008/06/15 04:38:52 tobias Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -593,6 +593,35 @@ rcs_head_set(RCSFILE *file, RCSNUM *rev)
return (0);
}
+/*
+ * rcs_branch_new()
+ *
+ * Create a new branch out of supplied revision for the RCS file <file>.
+ */
+RCSNUM *
+rcs_branch_new(RCSFILE *file, RCSNUM *rev)
+{
+ RCSNUM *brev;
+ struct rcs_sym *sym;
+
+ if ((brev = rcsnum_new_branch(rev)) == NULL)
+ return (NULL);
+
+ for (;;) {
+ TAILQ_FOREACH(sym, &(file->rf_symbols), rs_list)
+ if (!rcsnum_cmp(sym->rs_num, brev, 0))
+ break;
+
+ if (sym != NULL) {
+ if (rcsnum_inc(brev) == NULL ||
+ rcsnum_inc(brev) == NULL)
+ return (NULL);
+ } else
+ break;
+ }
+
+ return (brev);
+}
/*
* rcs_branch_get()