summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/commit.c
diff options
context:
space:
mode:
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);
}