From 8d550b2e6b5cfbb7c5bec4fb11ca72309a70e6db Mon Sep 17 00:00:00 2001 From: xsa Date: Mon, 30 May 2005 07:37:01 +0000 Subject: handle -r option; ok joris@ --- usr.bin/cvs/commit.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'usr.bin/cvs/commit.c') 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 * 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); } -- cgit v1.2.3-59-g8ed1b