diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-10-10 23:37:16 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-10-10 23:37:16 +0000 |
commit | c1819158b42f80389ff9a6937b6309e7d8897d22 (patch) | |
tree | 216ef03bce8454f4cbdf754f70341ff8ab8d86f7 /usr.bin/cvs | |
parent | b7df5ec04787a413e9241e726dfdaade2db9ff36 (diff) |
add rcs_rev_setlog() in the RCS api; used for setting log messages
of a revision to a specific value;
ok niallo@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/rcs.c | 29 | ||||
-rw-r--r-- | usr.bin/cvs/rcs.h | 3 |
2 files changed, 30 insertions, 2 deletions
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 <jfb@openbsd.org> * 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 <rev> to <logtext> + */ +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 <jfb@openbsd.org> * 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); |