summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/commit.c
diff options
context:
space:
mode:
authorxsa <xsa@openbsd.org>2005-05-30 07:37:01 +0000
committerxsa <xsa@openbsd.org>2005-05-30 07:37:01 +0000
commit8d550b2e6b5cfbb7c5bec4fb11ca72309a70e6db (patch)
tree230e2048b5b9dd18b4adf4aa29183fc2e3877116 /usr.bin/cvs/commit.c
parentcheck cvs_sendarg() return value; ok joris@ (diff)
downloadwireguard-openbsd-8d550b2e6b5cfbb7c5bec4fb11ca72309a70e6db.tar.xz
wireguard-openbsd-8d550b2e6b5cfbb7c5bec4fb11ca72309a70e6db.zip
handle -r option; ok joris@
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r--usr.bin/cvs/commit.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index a4c1276be21..f46f89fbcd6 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.34 2005/05/24 04:12:25 jfb Exp $ */
+/* $OpenBSD: commit.c,v 1.35 2005/05/30 07:37:01 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -64,6 +64,7 @@ struct cvs_cmd cvs_cmd_commit = {
};
static char *mfile = NULL;
+static char *rev = NULL;
static char **commit_files = NULL;
static int commit_fcount = 0;
@@ -94,6 +95,9 @@ cvs_commit_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg)
case 'R':
cmd->file_flags |= CF_RECURSE;
break;
+ case 'r':
+ rev = optarg;
+ break;
default:
return (CVS_EX_USAGE);
}
@@ -155,6 +159,14 @@ cvs_commit_pre_exec(struct cvsroot *root)
if (cvs_msg == NULL)
return (CVS_EX_DATA);
+ if (root->cr_method != CVS_METHOD_LOCAL) {
+ if (rev != NULL) {
+ if ((cvs_sendarg(root, "-r", 0) < 0) ||
+ (cvs_sendarg(root, rev, 0) < 0))
+ return (CVS_EX_PROTO);
+ }
+ }
+
return (0);
}