summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/cvs/rcs.c29
-rw-r--r--usr.bin/cvs/rcs.h3
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);