diff options
-rw-r--r-- | usr.bin/cvs/client.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/remote.h | 7 | ||||
-rw-r--r-- | usr.bin/cvs/server.c | 13 | ||||
-rw-r--r-- | usr.bin/cvs/tag.c | 36 |
4 files changed, 50 insertions, 10 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index 64746cd6ed7..3797a29a4b7 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.16 2006/11/08 20:20:42 xsa Exp $ */ +/* $OpenBSD: client.c,v 1.17 2006/11/09 09:24:28 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -62,7 +62,7 @@ struct cvs_req cvs_requests[] = { { "ci", 0, cvs_server_commit, 0 }, { "co", 0, NULL, 0 }, { "diff", 0, cvs_server_diff, 0 }, - { "tag", 0, NULL, 0 }, + { "tag", 0, cvs_server_tag, 0 }, { "status", 0, cvs_server_status, 0 }, { "admin", 0, NULL, 0 }, { "history", 0, NULL, 0 }, diff --git a/usr.bin/cvs/remote.h b/usr.bin/cvs/remote.h index 942300d1d3e..af38dff4db3 100644 --- a/usr.bin/cvs/remote.h +++ b/usr.bin/cvs/remote.h @@ -1,4 +1,4 @@ -/* $OpenBSD: remote.h,v 1.2 2006/10/31 15:23:40 xsa Exp $ */ +/* $OpenBSD: remote.h,v 1.3 2006/11/09 09:24:28 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -74,10 +74,11 @@ void cvs_server_argument(char *); void cvs_server_add(char *); void cvs_server_commit(char *); void cvs_server_diff(char *); +void cvs_server_log(char *); void cvs_server_remove(char *); -void cvs_server_update(char *); void cvs_server_status(char *); -void cvs_server_log(char *); +void cvs_server_tag(char *); +void cvs_server_update(char *); void cvs_remote_classify_file(struct cvs_file *); void cvs_remote_output(const char *); diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index 5bc1cc06381..65f04d7df99 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.31 2006/10/31 15:23:40 xsa Exp $ */ +/* $OpenBSD: server.c,v 1.32 2006/11/09 09:24:28 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -444,6 +444,17 @@ cvs_server_log(char *data) } void +cvs_server_tag(char *data) +{ + if (chdir(server_currentdir) == -1) + fatal("cvs_server_tag: %s", strerror(errno)); + + cvs_cmdop = CVS_OP_TAG; + cvs_getlog(server_argc, server_argv); + cvs_server_send_response("ok"); +} + +void cvs_server_update(char *data) { if (chdir(server_currentdir) == -1) diff --git a/usr.bin/cvs/tag.c b/usr.bin/cvs/tag.c index a8a6e8319b9..4eec200bf89 100644 --- a/usr.bin/cvs/tag.c +++ b/usr.bin/cvs/tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.49 2006/07/02 21:11:54 reyk Exp $ */ +/* $OpenBSD: tag.c,v 1.50 2006/11/09 09:24:28 xsa Exp $ */ /* * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> * @@ -19,6 +19,7 @@ #include "cvs.h" #include "log.h" +#include "remote.h" int cvs_tag(int, char **); void cvs_tag_local(struct cvs_file *); @@ -26,8 +27,8 @@ void cvs_tag_local(struct cvs_file *); static int tag_del(struct cvs_file *); static int tag_add(struct cvs_file *); -static int tag_delete = 0; -static int tag_force_move = 0; +static int tag_delete = 0; +static int tag_force_move = 0; static char *tag = NULL; static char *tag_date = NULL; static char *tag_name = NULL; @@ -109,7 +110,27 @@ cvs_tag(int argc, char **argv) cr.enterdir = NULL; cr.leavedir = NULL; - cr.fileproc = cvs_tag_local; + + if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) { + cr.fileproc = cvs_client_sendfile; + + if (tag_delete == 1) + cvs_client_send_request("Argument -d"); + + if (tag_force_move == 1) + cvs_client_send_request("Argument -F"); + + if (!(flags & CR_RECURSE_DIRS)) + cvs_client_send_request("Argument -l"); + + if (tag_oldname != NULL) + cvs_client_send_request("Argument -r%s", tag_oldname); + + cvs_client_send_request("Argument %s", tag_name); + } else { + cr.fileproc = cvs_tag_local; + } + cr.flags = flags; if (argc > 0) @@ -117,6 +138,13 @@ cvs_tag(int argc, char **argv) else cvs_file_run(1, &arg, &cr); + if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) { + cvs_client_send_files(argv, argc); + cvs_client_senddir("."); + cvs_client_send_request("tag"); + cvs_client_get_responses(); + } + return (0); } |