From c1819158b42f80389ff9a6937b6309e7d8897d22 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Mon, 10 Oct 2005 23:37:16 +0000 Subject: add rcs_rev_setlog() in the RCS api; used for setting log messages of a revision to a specific value; ok niallo@ --- usr.bin/cvs/rcs.c | 29 ++++++++++++++++++++++++++++- usr.bin/cvs/rcs.h | 3 ++- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'usr.bin/cvs') diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index bf4ee420698..313040627c5 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.85 2005/10/10 14:42:54 joris Exp $ */ +/* $OpenBSD: rcs.c,v 1.86 2005/10/10 23:37:15 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -2996,3 +2996,30 @@ rcs_deltatext_set(RCSFILE *rfp, RCSNUM *rev, const char *dtext) return (0); } + +/* + * rcs_rev_setlog() + * + * Sets the log message of revision to + */ +int +rcs_rev_setlog(RCSFILE *rfp, RCSNUM *rev, const char *logtext) +{ + struct rcs_delta *rdp; + char buf[16]; + + rcsnum_tostr(rev, buf, sizeof(buf)); + printf("setting log for %s to '%s'\n", buf, logtext); + + if ((rdp = rcs_findrev(rfp, rev)) == NULL) + return (-1); + + if (rdp->rd_log != NULL) + cvs_strfree(rdp->rd_log); + + if ((rdp->rd_log = cvs_strdup(logtext)) == NULL) + return (-1); + + rfp->rf_flags &= ~RCS_SYNCED; + return (0); +} diff --git a/usr.bin/cvs/rcs.h b/usr.bin/cvs/rcs.h index aaa78cf38fe..951b03ea4fd 100644 --- a/usr.bin/cvs/rcs.h +++ b/usr.bin/cvs/rcs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.h,v 1.33 2005/10/10 13:06:24 joris Exp $ */ +/* $OpenBSD: rcs.h,v 1.34 2005/10/10 23:37:15 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -210,6 +210,7 @@ int rcs_comment_set(RCSFILE *, const char *); int rcs_kwexp_set(RCSFILE *, int); int rcs_kwexp_get(RCSFILE *); int rcs_rev_add(RCSFILE *, RCSNUM *, const char *, time_t); +int rcs_rev_setlog(RCSFILE *, RCSNUM *, const char *); int rcs_rev_remove(RCSFILE *, RCSNUM *); RCSNUM *rcs_tag_resolve(RCSFILE *, const char *); const char *rcs_errstr(int); -- cgit v1.2.3