diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-10-11 15:50:26 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-10-11 15:50:26 +0000 |
commit | c9a02ff33ca195e6b02178cafca46f988686ec92 (patch) | |
tree | 9d2a537957ca21403f6ca74c983b692c93144aaa /usr.bin/rcs | |
parent | 614c8ab9c7e37350d96daf62e7f5f67e22c2ca6c (diff) |
- support -d <date> option in ci.
ok joris@
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r-- | usr.bin/rcs/Makefile | 6 | ||||
-rw-r--r-- | usr.bin/rcs/ci.c | 16 | ||||
-rw-r--r-- | usr.bin/rcs/rcsprog.h | 5 |
3 files changed, 17 insertions, 10 deletions
diff --git a/usr.bin/rcs/Makefile b/usr.bin/rcs/Makefile index 13657e013dc..4a7e6ef0891 100644 --- a/usr.bin/rcs/Makefile +++ b/usr.bin/rcs/Makefile @@ -1,12 +1,12 @@ -# $OpenBSD: Makefile,v 1.13 2005/10/06 16:26:43 mickey Exp $ +# $OpenBSD: Makefile,v 1.14 2005/10/11 15:50:25 niallo Exp $ .PATH: ${.CURDIR}/../cvs PROG= rcs MAN= rcs.1 -SRCS= ci.c co.c ident.c rcsclean.c rcsdiff.c rcsprog.c rlog.c buf.c diff.c \ - log.c rcs.c rcsnum.c strtab.c +SRCS= ci.c co.c ident.c rcsclean.c rcsdiff.c rcsprog.c rlog.c buf.c date.y \ + diff.c log.c rcs.c rcsnum.c strtab.c CPPFLAGS+=-I${.CURDIR}/../cvs -DRCSPROG # Don't build the links until we actually support those commands diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index aab43e245c3..5146ad4c122 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.19 2005/10/10 17:12:49 xsa Exp $ */ +/* $OpenBSD: ci.c,v 1.20 2005/10/11 15:50:25 niallo Exp $ */ /* * Copyright (c) 2005 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -38,6 +38,7 @@ #include <unistd.h> #include <signal.h> #include <string.h> +#include <time.h> #include "log.h" #include "rcs.h" @@ -71,6 +72,7 @@ checkin_main(int argc, char **argv) { int i, ch, dflag, flags, lkmode, interactive, rflag, status; mode_t fmode; + time_t date = -1; RCSFILE *file; RCSNUM *frev, *newrev; char fpath[MAXPATHLEN]; @@ -92,6 +94,12 @@ checkin_main(int argc, char **argv) while ((ch = getopt(argc, argv, "j:l::M:N:qu::d:r::m:k:V")) != -1) { switch (ch) { + case 'd': + if ((date = cvs_date_parse(optarg)) <= 0) { + cvs_log(LP_ERR, "invalide date"); + exit(1); + } + break; case 'h': (usage)(); exit(0); @@ -170,10 +178,6 @@ checkin_main(int argc, char **argv) continue; } - if (dflag) { - /* XXX */ - } - /* * Load file contents */ @@ -243,7 +247,7 @@ checkin_main(int argc, char **argv) * Now add our new revision */ if (rcs_rev_add(file, (newrev == NULL ? RCS_HEAD_REV : newrev), - rcs_msg, -1) != 0) { + rcs_msg, date) != 0) { cvs_log(LP_ERR, "failed to add new revision"); exit(1); } diff --git a/usr.bin/rcs/rcsprog.h b/usr.bin/rcs/rcsprog.h index 24a58871b4f..84fb8596091 100644 --- a/usr.bin/rcs/rcsprog.h +++ b/usr.bin/rcs/rcsprog.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsprog.h,v 1.8 2005/10/06 15:39:11 joris Exp $ */ +/* $OpenBSD: rcsprog.h,v 1.9 2005/10/11 15:50:25 niallo Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -31,6 +31,9 @@ extern char *__progname; extern const char rcs_version[]; extern int verbose; +/* date.y */ +time_t cvs_date_parse(const char *); + void rcs_usage(void); void checkout_usage(void); void checkin_usage(void); |