summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/commit.c
diff options
context:
space:
mode:
authorjoris <joris@openbsd.org>2006-06-01 20:00:52 +0000
committerjoris <joris@openbsd.org>2006-06-01 20:00:52 +0000
commit08458e593af3f35837753260cce2f99b72f37e93 (patch)
treeca79c883cea654645169c74ceb15d6c0d42d2a0f /usr.bin/cvs/commit.c
parentClean out more crap. Tweaks by jmc@. (diff)
downloadwireguard-openbsd-08458e593af3f35837753260cce2f99b72f37e93.tar.xz
wireguard-openbsd-08458e593af3f35837753260cce2f99b72f37e93.zip
major rewrite of some rcs parsing stuff:
- rework rcs_getrev() to correctly support branches - rework rcs_translate_tag() to correctly translate given symbols or branches into their matching revisions - rework rcs_rev_add() to correctly update its 'next' pointers and insert the new revision in the correct place on the list. - rework rcs_head_get() to return the latest revision on the default branch if it has been set or the normal HEAD revision otherwise. - no longer access the rf_head member of the RCSFILE struct manually, use the rcs_head_get() function which correctly returns the HEAD revision, there might be a default branch that has to be used. - for now, when commiting a new revision reset the default branch.
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r--usr.bin/cvs/commit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index ecbf62ab1f6..4a4bb408428 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.67 2006/05/31 23:27:38 joris Exp $ */
+/* $OpenBSD: commit.c,v 1.68 2006/06/01 20:00:52 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -165,7 +165,7 @@ cvs_commit_local(struct cvs_file *cf)
if (cf->file_status == FILE_MODIFIED ||
cf->file_status == FILE_REMOVED || (cf->file_status == FILE_ADDED
&& cf->file_rcs != NULL && cf->file_rcs->rf_dead == 1))
- rcsnum_tostr(cf->file_rcs->rf_head, rbuf, sizeof(rbuf));
+ rcsnum_tostr(rcs_head_get(cf->file_rcs), rbuf, sizeof(rbuf));
else
strlcpy(rbuf, "Non-existent", sizeof(rbuf));
@@ -260,6 +260,11 @@ cvs_commit_local(struct cvs_file *cf)
fatal("cvs_commit_local: failed to set state");
}
+ if (cf->file_rcs->rf_branch != NULL) {
+ rcsnum_free(cf->file_rcs->rf_branch);
+ cf->file_rcs->rf_branch = NULL;
+ }
+
rcs_write(cf->file_rcs);
if (cf->file_status == FILE_REMOVED) {