summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/commit.c
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2008-05-17 21:06:44 +0000
committertobias <tobias@openbsd.org>2008-05-17 21:06:44 +0000
commite1936db1afaf458ea8371bb03386dc2c52ab6951 (patch)
tree1d974fa78c8eed02d03f674609170d77af68b809 /usr.bin/cvs/commit.c
parentattach to the via vt8237s found on the hp 2133 mini-note (diff)
downloadwireguard-openbsd-e1936db1afaf458ea8371bb03386dc2c52ab6951.tar.xz
wireguard-openbsd-e1936db1afaf458ea8371bb03386dc2c52ab6951.zip
Full support of branches added. We lacked proper support of multiple
branch entry points in one revision as well as branches which started from other branches. ok joris
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r--usr.bin/cvs/commit.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index f785a425b6e..bcda61658d7 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.132 2008/03/09 03:14:52 joris Exp $ */
+/* $OpenBSD: commit.c,v 1.133 2008/05/17 21:06:44 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -365,28 +365,31 @@ cvs_commit_local(struct cvs_file *cf)
if (tag != NULL) {
rcsnum_free(crev);
+ rcsnum_free(rrev);
+ brev = rcs_sym_getrev(cf->file_rcs, tag);
crev = rcs_translate_tag(tag, cf->file_rcs);
- if (crev == NULL) {
+ if (brev == NULL || crev == NULL) {
fatal("failed to resolve existing tag: %s",
tag);
}
- if (RCSNUM_ISBRANCHREV(crev)) {
+ rrev = rcsnum_alloc();
+ rcsnum_cpy(brev, rrev, brev->rn_len - 1);
+
+ if (RCSNUM_ISBRANCHREV(crev) &&
+ rcsnum_cmp(crev, rrev, 0)) {
nrev = rcsnum_alloc();
rcsnum_cpy(crev, nrev, 0);
rcsnum_inc(nrev);
} else if (!RCSNUM_ISBRANCH(crev)) {
- brev = rcs_sym_getrev(cf->file_rcs, tag);
- if (brev == NULL)
- fatal("no more tag?");
nrev = rcsnum_brtorev(brev);
if (nrev == NULL)
fatal("failed to create branch rev");
- rcsnum_free(brev);
} else {
fatal("this isnt suppose to happen, honestly");
}
+ rcsnum_free(brev);
rcsnum_free(rrev);
rrev = rcsnum_branch_root(nrev);