diff options
-rw-r--r-- | usr.bin/cvs/add.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/admin.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/annotate.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/checkout.c | 16 | ||||
-rw-r--r-- | usr.bin/cvs/commit.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.h | 7 | ||||
-rw-r--r-- | usr.bin/cvs/diff.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/edit.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/file.c | 35 | ||||
-rw-r--r-- | usr.bin/cvs/getlog.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/history.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/import.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/release.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/remove.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/server.c | 22 | ||||
-rw-r--r-- | usr.bin/cvs/status.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/tag.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/update.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/watch.c | 6 |
19 files changed, 98 insertions, 52 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c index e715945ff12..18b0fd68b87 100644 --- a/usr.bin/cvs/add.c +++ b/usr.bin/cvs/add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: add.c,v 1.87 2008/01/29 12:22:59 tobias Exp $ */ +/* $OpenBSD: add.c,v 1.88 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> @@ -41,7 +41,7 @@ static char kbuf[8], *koptstr; char *logmsg; struct cvs_cmd cvs_cmd_add = { - CVS_OP_ADD, 0, "add", + CVS_OP_ADD, CVS_USE_WDIR, "add", { "ad", "new" }, "Add a new file or directory to the repository", "[-k mode] [-m message] ...", diff --git a/usr.bin/cvs/admin.c b/usr.bin/cvs/admin.c index 400cf148429..1c63c161fff 100644 --- a/usr.bin/cvs/admin.c +++ b/usr.bin/cvs/admin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: admin.c,v 1.52 2007/09/22 16:01:22 joris Exp $ */ +/* $OpenBSD: admin.c,v 1.53 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005 Joris Vink <joris@openbsd.org> @@ -34,7 +34,7 @@ void cvs_admin_local(struct cvs_file *); struct cvs_cmd cvs_cmd_admin = { - CVS_OP_ADMIN, 0, "admin", + CVS_OP_ADMIN, CVS_USE_WDIR, "admin", { "adm", "rcs" }, "Administrative front-end for RCS", "[-ILqU] [-A oldfile] [-a users] [-b branch]\n" diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c index 1df9b47fdf1..9d47c272ae9 100644 --- a/usr.bin/cvs/annotate.c +++ b/usr.bin/cvs/annotate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: annotate.c,v 1.44 2008/01/28 20:31:07 tobias Exp $ */ +/* $OpenBSD: annotate.c,v 1.45 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2007 Tobias Stoeckmann <tobias@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -34,7 +34,7 @@ extern char *cvs_specified_tag; static int force_head = 0; struct cvs_cmd cvs_cmd_annotate = { - CVS_OP_ANNOTATE, 0, "annotate", + CVS_OP_ANNOTATE, CVS_USE_WDIR, "annotate", { "ann", "blame" }, "Show last revision where each line was modified", "[-flR] [-D date | -r rev] [file ...]", diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c index 5c921ab7497..f0d8f1074fe 100644 --- a/usr.bin/cvs/checkout.c +++ b/usr.bin/cvs/checkout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: checkout.c,v 1.111 2008/01/28 21:35:09 tobias Exp $ */ +/* $OpenBSD: checkout.c,v 1.112 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -39,7 +39,7 @@ extern int build_dirs; static int flags = CR_REPO | CR_RECURSE_DIRS; struct cvs_cmd cvs_cmd_checkout = { - CVS_OP_CHECKOUT, 0, "checkout", + CVS_OP_CHECKOUT, CVS_USE_WDIR, "checkout", { "co", "get" }, "Checkout a working copy of a repository", "[-AcflNnPpRs] [-D date | -r tag] [-d dir] [-j rev] [-k mode] " @@ -50,7 +50,7 @@ struct cvs_cmd cvs_cmd_checkout = { }; struct cvs_cmd cvs_cmd_export = { - CVS_OP_EXPORT, 0, "export", + CVS_OP_EXPORT, CVS_USE_WDIR, "export", { "exp", "ex" }, "Export sources from CVS, similar to checkout", "[-flNnR] [-d dir] [-k mode] -D date | -r rev module ...", @@ -78,6 +78,7 @@ cvs_checkout(int argc, char **argv) prune_dirs = 1; break; case 'p': + cmdp->cmd_flags &= ~CVS_USE_WDIR; print_stdout = 1; cvs_noexec = 1; break; @@ -237,8 +238,13 @@ checkout_repository(const char *repobase, const char *wdbase) cvs_history_add((cvs_cmdop == CVS_OP_CHECKOUT) ? CVS_HISTORY_CHECKOUT : CVS_HISTORY_EXPORT, NULL, wdbase); - cr.enterdir = cvs_update_enterdir; - cr.leavedir = cvs_update_leavedir; + if (print_stdout) { + cr.enterdir = NULL; + cr.leavedir = NULL; + } else { + cr.enterdir = cvs_update_enterdir; + cr.leavedir = cvs_update_leavedir; + } cr.fileproc = cvs_update_local; cr.flags = flags; diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index cd1bf4c223d..bf3ed54f7d4 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.123 2008/01/29 11:58:59 tobias Exp $ */ +/* $OpenBSD: commit.c,v 1.124 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -42,7 +42,7 @@ int conflicts_found; char *logmsg = NULL; struct cvs_cmd cvs_cmd_commit = { - CVS_OP_COMMIT, 0, "commit", + CVS_OP_COMMIT, CVS_USE_WDIR, "commit", { "ci", "com" }, "Check files into the repository", "[-flR] [-F logfile | -m msg] [-r rev] ...", diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index e8e4ede6ea7..7f4751c03b0 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.148 2008/01/10 10:05:40 tobias Exp $ */ +/* $OpenBSD: cvs.h,v 1.149 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -100,6 +100,9 @@ #define CVS_CMD_MAXDESCRLEN 64 #define CVS_CMD_MAXARG 128 +/* flags */ +#define CVS_USE_WDIR 1 + /* defaults */ #define CVS_SERVER_DEFAULT "cvs" #define CVS_RSH_DEFAULT "ssh" @@ -166,7 +169,7 @@ void cvs_history_add(int, struct cvs_file *, const char *); struct cvs_cmd { u_int cmd_op; - u_int cmd_req; + u_int cmd_flags; char cmd_name[CVS_CMD_MAXNAMELEN]; char cmd_alias[CVS_CMD_MAXALIAS][CVS_CMD_MAXNAMELEN]; char cmd_descr[CVS_CMD_MAXDESCRLEN]; diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index dcbf6aa5b21..7428d347a62 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.123 2008/01/29 12:00:34 tobias Exp $ */ +/* $OpenBSD: diff.c,v 1.124 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -32,7 +32,7 @@ static char *rev1 = NULL; static char *rev2 = NULL; struct cvs_cmd cvs_cmd_diff = { - CVS_OP_DIFF, 0, "diff", + CVS_OP_DIFF, CVS_USE_WDIR, "diff", { "di", "dif" }, "Show differences between revisions", "[-cilNnpRu] [[-D date] [-r rev] [-D date2 | -r rev2]] " diff --git a/usr.bin/cvs/edit.c b/usr.bin/cvs/edit.c index 2eff2d8af25..209f9170041 100644 --- a/usr.bin/cvs/edit.c +++ b/usr.bin/cvs/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.41 2008/01/28 20:31:07 tobias Exp $ */ +/* $OpenBSD: edit.c,v 1.42 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006, 2007 Xavier Santolaria <xsa@openbsd.org> * @@ -42,7 +42,7 @@ static RCSNUM *cvs_base_handle(struct cvs_file *, int); static int edit_aflags = 0; struct cvs_cmd cvs_cmd_edit = { - CVS_OP_EDIT, 0, "edit", + CVS_OP_EDIT, CVS_USE_WDIR, "edit", { }, "Get ready to edit a watched file", "[-lR] [-a action] [file ...]", @@ -52,7 +52,7 @@ struct cvs_cmd cvs_cmd_edit = { }; struct cvs_cmd cvs_cmd_editors = { - CVS_OP_EDITORS, 0, "editors", + CVS_OP_EDITORS, CVS_USE_WDIR, "editors", { }, "See who is editing a watched file", "[-lR] [file ...]", @@ -62,7 +62,7 @@ struct cvs_cmd cvs_cmd_editors = { }; struct cvs_cmd cvs_cmd_unedit = { - CVS_OP_UNEDIT, 0, "unedit", + CVS_OP_UNEDIT, CVS_USE_WDIR, "unedit", { }, "Undo an edit command", "[-lR] [file ...]", diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index 20ad6350a08..aef69b652c8 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.210 2008/01/21 16:36:46 tobias Exp $ */ +/* $OpenBSD: file.c,v 1.211 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -370,15 +370,24 @@ cvs_file_walkdir(struct cvs_file *cf, struct cvs_recursion *cr) return; /* + * If this is a repository-only command, do not touch any + * locally available directories or try to create them. + */ + if (!(cmdp->cmd_flags & CVS_USE_WDIR)) { + TAILQ_INIT(&fl); + TAILQ_INIT(&dl); + goto walkrepo; + } + + /* * If we do not have a admin directory inside here, dont bother, - * unless we are running export, import, rlog or rtag. + * unless we are running export or import. */ (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", cf->file_path, CVS_PATH_CVSDIR); l = stat(fpath, &st); if (cvs_cmdop != CVS_OP_EXPORT && cvs_cmdop != CVS_OP_IMPORT && - cvs_cmdop != CVS_OP_RLOG && cvs_cmdop != CVS_OP_RTAG && (l == -1 || (l == 0 && !S_ISDIR(st.st_mode)))) { return; } @@ -530,6 +539,7 @@ cvs_file_walkdir(struct cvs_file *cf, struct cvs_recursion *cr) cvs_ent_close(entlist, ENT_NOSYNC); +walkrepo: if (cr->flags & CR_REPO) { cvs_get_repository_path(cf->file_path, repo, MAXPATHLEN); cvs_repository_lock(repo); @@ -550,7 +560,7 @@ cvs_file_walkdir(struct cvs_file *cf, struct cvs_recursion *cr) if (cr->leavedir != NULL) cr->leavedir(cf); - if (cvs_directory_tag != NULL) { + if (cvs_directory_tag != NULL && cmdp->cmd_flags & CVS_USE_WDIR) { cvs_write_tagfile(cf->file_path, cvs_directory_tag, NULL, 0); xfree(cvs_directory_tag); cvs_directory_tag = NULL; @@ -594,17 +604,20 @@ cvs_file_classify(struct cvs_file *cf, const char *tag) (void)xsnprintf(rcsfile, MAXPATHLEN, "%s/%s", repo, cf->file_name); - if (cvs_cmdop != CVS_OP_RLOG && cvs_cmdop != CVS_OP_RTAG && - cf->file_type == CVS_FILE) { + if (cf->file_type == CVS_FILE) { len = strlcat(rcsfile, RCS_FILE_EXT, MAXPATHLEN); if (len >= MAXPATHLEN) fatal("cvs_file_classify: truncation"); } cf->file_rpath = xstrdup(rcsfile); - entlist = cvs_ent_open(cf->file_wd); - cf->file_ent = cvs_ent_get(entlist, cf->file_name); - cvs_ent_close(entlist, ENT_NOSYNC); + + if (cmdp->cmd_flags & CVS_USE_WDIR) { + entlist = cvs_ent_open(cf->file_wd); + cf->file_ent = cvs_ent_get(entlist, cf->file_name); + cvs_ent_close(entlist, ENT_NOSYNC); + } else + cf->file_ent = NULL; if (cf->file_ent != NULL) { if (cf->file_ent->ce_type == CVS_ENT_DIR && @@ -621,7 +634,9 @@ cvs_file_classify(struct cvs_file *cf, const char *tag) } if (cf->file_type == CVS_DIR) { - if (cf->fd == -1 && stat(rcsfile, &st) != -1) + if (!(cmdp->cmd_flags & CVS_USE_WDIR)) + cf->file_status = FILE_UPTODATE; + else if (cf->fd == -1 && stat(rcsfile, &st) != -1) cf->file_status = DIR_CREATE; else if (cf->file_ent != NULL || cvs_cmdop == CVS_OP_RLOG || cvs_cmdop == CVS_OP_RTAG) diff --git a/usr.bin/cvs/getlog.c b/usr.bin/cvs/getlog.c index 0e4d17c8ad3..77ab794e172 100644 --- a/usr.bin/cvs/getlog.c +++ b/usr.bin/cvs/getlog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getlog.c,v 1.80 2008/01/12 22:39:32 tobias Exp $ */ +/* $OpenBSD: getlog.c,v 1.81 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> * Copyright (c) 2006 Joris Vink <joris@openbsd.org> @@ -40,7 +40,7 @@ char *slist = NULL; char *wlist = NULL; struct cvs_cmd cvs_cmd_log = { - CVS_OP_LOG, 0, "log", + CVS_OP_LOG, CVS_USE_WDIR, "log", { "lo" }, "Print out history information for files", "[-bhlNRt] [-d dates] [-r revisions] [-s states] [-w logins]", @@ -106,6 +106,8 @@ cvs_getlog(int argc, char **argv) argv += optind; if (cvs_cmdop == CVS_OP_RLOG) { + flags |= CR_REPO; + if (argc == 0) return 0; diff --git a/usr.bin/cvs/history.c b/usr.bin/cvs/history.c index c7fea5a6af8..f1cd4d99ae7 100644 --- a/usr.bin/cvs/history.c +++ b/usr.bin/cvs/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.34 2007/09/10 10:56:37 tobias Exp $ */ +/* $OpenBSD: history.c,v 1.35 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2007 Joris Vink <joris@openbsd.org> * @@ -30,7 +30,7 @@ void cvs_history_local(struct cvs_file *); struct cvs_cmd cvs_cmd_history = { - CVS_OP_HISTORY, 0, "history", + CVS_OP_HISTORY, CVS_USE_WDIR, "history", { "hi", "his" }, /* omghi2you */ "Display history of actions done in the base repository", "[-ac]", diff --git a/usr.bin/cvs/import.c b/usr.bin/cvs/import.c index 9591616a476..fd05d986440 100644 --- a/usr.bin/cvs/import.c +++ b/usr.bin/cvs/import.c @@ -1,4 +1,4 @@ -/* $OpenBSD: import.c,v 1.79 2008/01/10 09:54:04 tobias Exp $ */ +/* $OpenBSD: import.c,v 1.80 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -47,7 +47,7 @@ char *import_repository = NULL; int import_conflicts = 0; struct cvs_cmd cvs_cmd_import = { - CVS_OP_IMPORT, 0, "import", + CVS_OP_IMPORT, CVS_USE_WDIR, "import", { "im", "imp" }, "Import sources into CVS, using vendor branches", "[-b branch] [-d] [-k mode] [-m message] " diff --git a/usr.bin/cvs/release.c b/usr.bin/cvs/release.c index 9b1c76fabd8..fb02dbd86cb 100644 --- a/usr.bin/cvs/release.c +++ b/usr.bin/cvs/release.c @@ -1,4 +1,4 @@ -/* $OpenBSD: release.c,v 1.37 2008/01/10 10:05:40 tobias Exp $ */ +/* $OpenBSD: release.c,v 1.38 2008/01/31 10:15:05 tobias Exp $ */ /*- * Copyright (c) 2005-2007 Xavier Santolaria <xsa@openbsd.org> * @@ -31,7 +31,7 @@ static int dflag = 0; static int files_altered = 0; struct cvs_cmd cvs_cmd_release = { - CVS_OP_RELEASE, 0, "release", + CVS_OP_RELEASE, CVS_USE_WDIR, "release", { "re", "rel" }, "Indicate that a Module is no longer in use", "[-d] dir...", diff --git a/usr.bin/cvs/remove.c b/usr.bin/cvs/remove.c index eb2fa0e3e66..026e783c3b0 100644 --- a/usr.bin/cvs/remove.c +++ b/usr.bin/cvs/remove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: remove.c,v 1.68 2008/01/28 20:31:07 tobias Exp $ */ +/* $OpenBSD: remove.c,v 1.69 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> * @@ -32,7 +32,7 @@ static int removed = 0; static int existing = 0; struct cvs_cmd cvs_cmd_remove = { - CVS_OP_REMOVE, 0, "remove", + CVS_OP_REMOVE, CVS_USE_WDIR, "remove", { "rm", "delete" }, "Remove an entry from the repository", "[-flR] [file ...]", diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index f17b5864132..3ab60d518ed 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.77 2008/01/29 12:01:52 tobias Exp $ */ +/* $OpenBSD: server.c,v 1.78 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -76,7 +76,7 @@ static char *server_argv[CVS_CMD_MAXARG]; static int server_argc = 1; struct cvs_cmd cvs_cmd_server = { - CVS_OP_SERVER, 0, "server", { "", "" }, + CVS_OP_SERVER, CVS_USE_WDIR, "server", { "", "" }, "server mode", NULL, NULL, @@ -504,6 +504,7 @@ cvs_server_add(char *data) fatal("cvs_server_add: %s", strerror(errno)); cvs_cmdop = CVS_OP_ADD; + cmdp->cmd_flags = cvs_cmd_add.cmd_flags; cvs_add(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -515,6 +516,7 @@ cvs_server_import(char *data) fatal("cvs_server_import: %s", strerror(errno)); cvs_cmdop = CVS_OP_IMPORT; + cmdp->cmd_flags = cvs_cmd_import.cmd_flags; cvs_import(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -526,6 +528,7 @@ cvs_server_admin(char *data) fatal("cvs_server_admin: %s", strerror(errno)); cvs_cmdop = CVS_OP_ADMIN; + cmdp->cmd_flags = cvs_cmd_admin.cmd_flags; cvs_admin(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -537,6 +540,7 @@ cvs_server_annotate(char *data) fatal("cvs_server_annotate: %s", strerror(errno)); cvs_cmdop = CVS_OP_ANNOTATE; + cmdp->cmd_flags = cvs_cmd_annotate.cmd_flags; cvs_annotate(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -548,6 +552,7 @@ cvs_server_commit(char *data) fatal("cvs_server_commit: %s", strerror(errno)); cvs_cmdop = CVS_OP_COMMIT; + cmdp->cmd_flags = cvs_cmd_commit.cmd_flags; cvs_commit(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -559,6 +564,7 @@ cvs_server_checkout(char *data) fatal("cvs_server_checkout: %s", strerror(errno)); cvs_cmdop = CVS_OP_CHECKOUT; + cmdp->cmd_flags = cvs_cmd_checkout.cmd_flags; cvs_checkout(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -570,6 +576,7 @@ cvs_server_diff(char *data) fatal("cvs_server_diff: %s", strerror(errno)); cvs_cmdop = CVS_OP_DIFF; + cmdp->cmd_flags = cvs_cmd_diff.cmd_flags; cvs_diff(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -581,6 +588,7 @@ cvs_server_export(char *data) fatal("cvs_server_export: %s", strerror(errno)); cvs_cmdop = CVS_OP_EXPORT; + cmdp->cmd_flags = cvs_cmd_export.cmd_flags; cvs_checkout(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -598,6 +606,7 @@ cvs_server_init(char *data) fatal("Invalid argument for init"); cvs_cmdop = CVS_OP_INIT; + cmdp->cmd_flags = cvs_cmd_init.cmd_flags; cvs_init(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -609,6 +618,7 @@ cvs_server_release(char *data) fatal("cvs_server_release: %s", strerror(errno)); cvs_cmdop = CVS_OP_RELEASE; + cmdp->cmd_flags = cvs_cmd_release.cmd_flags; cvs_release(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -620,6 +630,7 @@ cvs_server_remove(char *data) fatal("cvs_server_remove: %s", strerror(errno)); cvs_cmdop = CVS_OP_REMOVE; + cmdp->cmd_flags = cvs_cmd_remove.cmd_flags; cvs_remove(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -631,6 +642,7 @@ cvs_server_status(char *data) fatal("cvs_server_status: %s", strerror(errno)); cvs_cmdop = CVS_OP_STATUS; + cmdp->cmd_flags = cvs_cmd_status.cmd_flags; cvs_status(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -642,6 +654,7 @@ cvs_server_log(char *data) fatal("cvs_server_log: %s", strerror(errno)); cvs_cmdop = CVS_OP_LOG; + cmdp->cmd_flags = cvs_cmd_log.cmd_flags; cvs_getlog(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -653,6 +666,7 @@ cvs_server_rlog(char *data) fatal("cvs_server_rlog: %s", strerror(errno)); cvs_cmdop = CVS_OP_RLOG; + cmdp->cmd_flags = cvs_cmd_rlog.cmd_flags; cvs_getlog(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -664,6 +678,7 @@ cvs_server_tag(char *data) fatal("cvs_server_tag: %s", strerror(errno)); cvs_cmdop = CVS_OP_TAG; + cmdp->cmd_flags = cvs_cmd_tag.cmd_flags; cvs_tag(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -675,6 +690,7 @@ cvs_server_rtag(char *data) fatal("cvs_server_rtag: %s", strerror(errno)); cvs_cmdop = CVS_OP_RTAG; + cmdp->cmd_flags = cvs_cmd_rtag.cmd_flags; cvs_tag(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -686,6 +702,7 @@ cvs_server_update(char *data) fatal("cvs_server_update: %s", strerror(errno)); cvs_cmdop = CVS_OP_UPDATE; + cmdp->cmd_flags = cvs_cmd_update.cmd_flags; cvs_update(server_argc, server_argv); cvs_server_send_response("ok"); } @@ -694,6 +711,7 @@ void cvs_server_version(char *data) { cvs_cmdop = CVS_OP_VERSION; + cmdp->cmd_flags = cvs_cmd_version.cmd_flags; cvs_version(server_argc, server_argv); cvs_server_send_response("ok"); } diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c index 843c9cb1578..fe2b7c7cbc8 100644 --- a/usr.bin/cvs/status.c +++ b/usr.bin/cvs/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.79 2008/01/28 20:31:07 tobias Exp $ */ +/* $OpenBSD: status.c,v 1.80 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> @@ -27,7 +27,7 @@ void cvs_status_local(struct cvs_file *); static int show_sym = 0; struct cvs_cmd cvs_cmd_status = { - CVS_OP_STATUS, 0, "status", + CVS_OP_STATUS, CVS_USE_WDIR, "status", { "st", "stat" }, "Display status information on checked out files", "[-lRv]", diff --git a/usr.bin/cvs/tag.c b/usr.bin/cvs/tag.c index 1628e026418..e753d8acabc 100644 --- a/usr.bin/cvs/tag.c +++ b/usr.bin/cvs/tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.62 2008/01/28 20:31:07 tobias Exp $ */ +/* $OpenBSD: tag.c,v 1.63 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> * @@ -49,7 +49,7 @@ struct cvs_cmd cvs_cmd_rtag = { }; struct cvs_cmd cvs_cmd_tag = { - CVS_OP_TAG, 0, "tag", + CVS_OP_TAG, CVS_USE_WDIR, "tag", { "ta", "freeze" }, "Add a symbolic tag to checked out version of files", "[-bcdFflR] [-D date | -r rev] tag [file ...]", @@ -102,6 +102,8 @@ cvs_tag(int argc, char **argv) argv += optind; if (cvs_cmdop == CVS_OP_RTAG) { + flags |= CR_REPO; + if (argc < 2) fatal("%s", cvs_cmd_rtag.cmd_synopsis); diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c index f510e58d61d..4a937f16901 100644 --- a/usr.bin/cvs/update.c +++ b/usr.bin/cvs/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.115 2008/01/28 20:31:07 tobias Exp $ */ +/* $OpenBSD: update.c,v 1.116 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -35,7 +35,7 @@ char *cvs_specified_tag = NULL; static void update_clear_conflict(struct cvs_file *); struct cvs_cmd cvs_cmd_update = { - CVS_OP_UPDATE, 0, "update", + CVS_OP_UPDATE, CVS_USE_WDIR, "update", { "up", "upd" }, "Bring work tree in sync with repository", "[-ACdflPpR] [-D date | -r rev] [-I ign] [-j rev] [-k mode] " diff --git a/usr.bin/cvs/watch.c b/usr.bin/cvs/watch.c index 0abc46bd83d..0073d5f9042 100644 --- a/usr.bin/cvs/watch.c +++ b/usr.bin/cvs/watch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: watch.c,v 1.19 2008/01/28 20:31:07 tobias Exp $ */ +/* $OpenBSD: watch.c,v 1.20 2008/01/31 10:15:05 tobias Exp $ */ /* * Copyright (c) 2005-2007 Xavier Santolaria <xsa@openbsd.org> * @@ -37,7 +37,7 @@ static int watch_req = 0; static int watch_aflags = 0; struct cvs_cmd cvs_cmd_watch = { - CVS_OP_WATCH, 0, "watch", + CVS_OP_WATCH, CVS_USE_WDIR, "watch", { }, "Set watches", "on | off | add | remove [-lR] [-a action] [file ...]", @@ -47,7 +47,7 @@ struct cvs_cmd cvs_cmd_watch = { }; struct cvs_cmd cvs_cmd_watchers = { - CVS_OP_WATCHERS, 0, "watchers", + CVS_OP_WATCHERS, CVS_USE_WDIR, "watchers", { }, "See who is watching a file", "[-lR] [file ...]", |