=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rcs/ci.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- src/usr.bin/rcs/ci.c 2005/10/27 07:43:56 1.50 +++ src/usr.bin/rcs/ci.c 2005/10/29 19:05:51 1.51 @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.50 2005/10/27 07:43:56 xsa Exp $ */ +/* $OpenBSD: ci.c,v 1.51 2005/10/29 19:05:51 niallo Exp $ */ /* * Copyright (c) 2005 Niall O'Higgins * All rights reserved. @@ -79,19 +79,20 @@ RCSNUM *frev, *newrev; char fpath[MAXPATHLEN]; char *rcs_msg, *filec, *deltatext, *username, rbuf[16]; - const char *symbol = NULL; + const char *symbol, *state; struct rcs_lock *lkp; BUF *bp; date = DATE_NOW; file = NULL; rcs_msg = username = NULL; + state = symbol = NULL; newrev = NULL; fmode = force = lkmode = rflag = status = symforce = 0; interactive = 1; - while ((ch = rcs_getopt(argc, argv, "d::f::j:k:l::m:M:N:n:qr::u::Vw:")) != -1) { + while ((ch = rcs_getopt(argc, argv, "d::f::j:k:l::m:M:N:n:qr::s:u::Vw:")) != -1) { switch (ch) { case 'd': if (rcs_optarg == NULL) @@ -144,6 +145,13 @@ rcs_set_rev(rcs_optarg, &newrev); rflag = 1; break; + case 's': + state = rcs_optarg; + if (rcs_state_check(state) < 0) { + cvs_log(LP_ERR, "invalid state `%'", state); + exit(1); + } + break; case 'u': rcs_set_rev(rcs_optarg, &newrev); lkmode = LOCK_UNLOCK; @@ -357,6 +365,12 @@ continue; } } + + /* + * Set the state of this revision if specified. + */ + if (state != NULL) + (void)rcs_state_set(file, newrev, state); free(deltatext); free(filec);