diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-06-28 13:20:54 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-06-28 13:20:54 +0000 |
commit | 49ca05ee33ae91764b26ae12fc159b4498380a40 (patch) | |
tree | dfa8c20cbfd4468f03d47f9d0c56660313350168 | |
parent | bc2a81b8022a185efb7d28eb0220436e0c00bba2 (diff) |
- add `rtag' command usage
- add -F and -f
ok joris
-rw-r--r-- | usr.bin/cvs/tag.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/usr.bin/cvs/tag.c b/usr.bin/cvs/tag.c index 67699f970a6..933b2e6e956 100644 --- a/usr.bin/cvs/tag.c +++ b/usr.bin/cvs/tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.20 2005/05/31 08:26:40 xsa Exp $ */ +/* $OpenBSD: tag.c,v 1.21 2005/06/28 13:20:53 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2004 Joris Vink <joris@openbsd.org> @@ -48,6 +48,7 @@ static char *tag_oldname = NULL; static int tag_branch = 0; static int tag_delete = 0; static int tag_forcehead = 0; +static int tag_forcemove = 0; struct cvs_cmd cvs_cmd_tag = { CVS_OP_TAG, CVS_REQ_TAG, "tag", @@ -71,8 +72,8 @@ struct cvs_cmd cvs_cmd_rtag = { CVS_OP_RTAG, CVS_REQ_TAG, "rtag", { }, "Add a symbolic tag to a module", - "", - "", + "[-abdFflnR] [-D date | -r rev] symbolic_tag modules ...", + "abD:fFflnRr:", NULL, CF_SORT | CF_IGNORE | CF_RECURSE, cvs_tag_init, @@ -99,6 +100,9 @@ cvs_tag_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) case 'd': tag_delete = 1; break; + case 'F': + tag_forcemove = 1; + break; case 'f': tag_forcehead = 1; break; @@ -168,17 +172,19 @@ cvs_tag_pre_exec(struct cvsroot *root) if (tag_delete && (cvs_sendarg(root, "-d", 0) < 0)) return (CVS_EX_PROTO); - if (tag_oldname) { - if ((cvs_sendarg(root, "-r", 0) < 0) || - (cvs_sendarg(root, tag_oldname, 0) < 0)) + if (tag_forcemove && (cvs_sendarg(root, "-F", 0) < 0)) + return (CVS_EX_PROTO); + + if (tag_forcehead && (cvs_sendarg(root, "-f", 0) < 0)) + return (CVS_EX_PROTO); + + if ((tag_oldname) && ((cvs_sendarg(root, "-r", 0) < 0) || + (cvs_sendarg(root, tag_oldname, 0) < 0))) return (CVS_EX_PROTO); - } - if (tag_date) { - if ((cvs_sendarg(root, "-D", 0) < 0) || - (cvs_sendarg(root, tag_date, 0) < 0)) + if ((tag_date) && ((cvs_sendarg(root, "-D", 0) < 0) || + (cvs_sendarg(root, tag_date, 0) < 0))) return (CVS_EX_PROTO); - } if (cvs_sendarg(root, tag_name, 0) < 0) return (CVS_EX_PROTO); |