From 91b2539f3bccc40a19757de24447e2354b98f1dd Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Thu, 1 Jun 2006 20:00:53 +0000 Subject: 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. --- usr.bin/cvs/add.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.bin/cvs/add.c') diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c index cef95503659..4cea0ab5246 100644 --- a/usr.bin/cvs/add.c +++ b/usr.bin/cvs/add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: add.c,v 1.51 2006/05/30 21:32:52 joris Exp $ */ +/* $OpenBSD: add.c,v 1.52 2006/06/01 20:00:52 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * @@ -175,10 +175,12 @@ add_file(struct cvs_file *cf) BUF *b; int added, l, stop; char *entry, revbuf[16], tbuf[32]; + RCSNUM *head; CVSENTRIES *entlist; if (cf->file_rcs != NULL) - rcsnum_tostr(cf->file_rcs->rf_head, revbuf, sizeof(revbuf)); + rcsnum_tostr(rcs_head_get(cf->file_rcs), + revbuf, sizeof(revbuf)); added = stop = 0; switch (cf->file_status) { @@ -216,7 +218,8 @@ add_file(struct cvs_file *cf) xfree(entry); - b = rcs_getrev(cf->file_rcs, cf->file_rcs->rf_head); + head = rcs_head_get(cf->file_rcs); + b = rcs_getrev(cf->file_rcs, head); if (b == NULL) fatal("cvs_add_local: failed to get HEAD"); -- cgit v1.2.3