From 49ca05ee33ae91764b26ae12fc159b4498380a40 Mon Sep 17 00:00:00 2001 From: Xavier Santolaria Date: Tue, 28 Jun 2005 13:20:54 +0000 Subject: - add `rtag' command usage - add -F and -f ok joris --- usr.bin/cvs/tag.c | 28 +++++++++++++++++----------- 1 file 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 * Copyright (c) 2004 Joris Vink @@ -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); -- cgit v1.2.3