summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2007-02-01 09:45:44 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2007-02-01 09:45:44 +0000
commit6e46e1457caf3fa6744e4c9fe37d5827407ceef2 (patch)
tree4b0794e66a8cb0cad57e5d930b7b9b774a4b96e4 /usr.bin
parenta777ad9e26b2a0e2e9bf21b52934a353580f4239 (diff)
add support for [-k mode]; tests/input/ok otto@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/admin.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/usr.bin/cvs/admin.c b/usr.bin/cvs/admin.c
index dfdc365dd80..fa0e2ee6210 100644
--- a/usr.bin/cvs/admin.c
+++ b/usr.bin/cvs/admin.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: admin.c,v 1.46 2007/01/25 18:56:33 otto Exp $ */
+/* $OpenBSD: admin.c,v 1.47 2007/02/01 09:45:43 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
- * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
+ * Copyright (c) 2006, 2007 Xavier Santolaria <xsa@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -43,7 +43,8 @@ struct cvs_cmd cvs_cmd_admin = {
static int runflags = 0;
static int lkmode = RCS_LOCK_INVAL;
-static char *alist, *comment, *elist, *logmsg, *logstr;
+static int kflag = RCS_KWEXP_DEFAULT;
+static char *alist, *comment, *elist, *logmsg, *logstr, *koptstr;
static char *oldfilename, *orange, *state, *statestr;
static RCSNUM *logrev;
@@ -79,6 +80,13 @@ cvs_admin(int argc, char **argv)
case 'I':
break;
case 'k':
+ koptstr = optarg;
+ kflag = rcs_kflag_get(koptstr);
+ if (RCS_KWEXP_INVAL(kflag)) {
+ cvs_log(LP_ERR,
+ "invalid RCS keyword expension mode");
+ fatal("%s", cvs_cmd_admin.cmd_synopsis);
+ }
break;
case 'L':
if (lkmode == RCS_LOCK_LOOSE) {
@@ -147,6 +155,9 @@ cvs_admin(int argc, char **argv)
cvs_client_send_request("Argument -e%s",
(elist != NULL) ? elist : "");
+ if (koptstr != NULL)
+ cvs_client_send_request("Argument -k%s", koptstr);
+
if (lkmode == RCS_LOCK_STRICT)
cvs_client_send_request("Argument -L");
else if (lkmode == RCS_LOCK_LOOSE)
@@ -282,6 +293,13 @@ cvs_admin_local(struct cvs_file *cf)
cf->file_rcs->rf_flags &= ~RCS_SYNCED;
}
+ /* Default `-kv' is accepted here. */
+ if (koptstr != NULL) {
+ if (cf->file_rcs->rf_expand == NULL ||
+ strcmp(cf->file_rcs->rf_expand, koptstr) != 0)
+ rcs_kwexp_set(cf->file_rcs, kflag);
+ }
+
if (logstr != NULL) {
if ((logmsg = strchr(logstr, ':')) == NULL) {
cvs_log(LP_ERR, "missing log message");