diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-11-09 14:00:15 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-11-09 14:00:15 +0000 |
commit | bfe98499c119cc63608361219abc3def12f7d15f (patch) | |
tree | 12934b8a11ee4cd172acc8b9fa43814911d477b1 /usr.bin/cvs | |
parent | bb8c8c4c2c4a61c068810f37f2baae59b88990a8 (diff) |
cvs init remote bits.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/client.c | 5 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/init.c | 9 | ||||
-rw-r--r-- | usr.bin/cvs/remote.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/server.c | 13 |
5 files changed, 25 insertions, 8 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index 3797a29a4b7..c78ecf61f1a 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.17 2006/11/09 09:24:28 xsa Exp $ */ +/* $OpenBSD: client.c,v 1.18 2006/11/09 14:00:14 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -236,7 +236,8 @@ cvs_client_connect_to_server(void) cvs_client_initlog(); - cvs_client_send_request("Root %s", current_cvsroot->cr_dir); + if (cvs_cmdop != CVS_OP_INIT) + cvs_client_send_request("Root %s", current_cvsroot->cr_dir); resp = client_get_supported_responses(); cvs_client_send_request("Valid-responses %s", resp); diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index 9a28271732b..ddc091325f7 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.118 2006/11/09 10:08:33 xsa Exp $ */ +/* $OpenBSD: cvs.h,v 1.119 2006/11/09 14:00:14 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -365,6 +365,7 @@ int cvs_add(int, char **); int cvs_commit(int, char **); int cvs_diff(int, char **); int cvs_getlog(int, char **); +int cvs_init(int, char **); int cvs_remove(int, char **); int cvs_status(int, char **); int cvs_tag(int, char **); diff --git a/usr.bin/cvs/init.c b/usr.bin/cvs/init.c index c6e7504f6bc..d3747d425ec 100644 --- a/usr.bin/cvs/init.c +++ b/usr.bin/cvs/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.25 2006/06/16 14:07:42 joris Exp $ */ +/* $OpenBSD: init.c,v 1.26 2006/11/09 14:00:14 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -30,8 +30,8 @@ #include "cvs.h" #include "init.h" #include "log.h" +#include "remote.h" -int cvs_init(int, char **); void cvs_init_local(void); static void init_mkdir(const char *, mode_t); @@ -81,7 +81,10 @@ cvs_init(int argc, char **argv) if (argc > 1) fatal("init does not take any extra arguments"); - if (current_cvsroot->cr_method == CVS_METHOD_LOCAL) + if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) { + cvs_client_send_request("init %s", current_cvsroot->cr_dir); + cvs_client_get_responses(); + } else cvs_init_local(); return (0); diff --git a/usr.bin/cvs/remote.h b/usr.bin/cvs/remote.h index af38dff4db3..b695fe0562a 100644 --- a/usr.bin/cvs/remote.h +++ b/usr.bin/cvs/remote.h @@ -1,4 +1,4 @@ -/* $OpenBSD: remote.h,v 1.3 2006/11/09 09:24:28 xsa Exp $ */ +/* $OpenBSD: remote.h,v 1.4 2006/11/09 14:00:14 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -74,6 +74,7 @@ void cvs_server_argument(char *); void cvs_server_add(char *); void cvs_server_commit(char *); void cvs_server_diff(char *); +void cvs_server_init(char *); void cvs_server_log(char *); void cvs_server_remove(char *); void cvs_server_status(char *); diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index 5c82e546660..ac29c8ad1cd 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.33 2006/11/09 10:08:33 xsa Exp $ */ +/* $OpenBSD: server.c,v 1.34 2006/11/09 14:00:14 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -411,6 +411,17 @@ cvs_server_diff(char *data) } void +cvs_server_init(char *data) +{ + if (chdir(server_currentdir) == -1) + fatal("cvs_server_init: %s", strerror(errno)); + + cvs_cmdop = CVS_OP_INIT; + cvs_init(server_argc, server_argv); + cvs_server_send_response("ok"); +} + +void cvs_server_remove(char *data) { if (chdir(server_currentdir) == -1) |