diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-09-07 19:36:06 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-09-07 19:36:06 +0000 |
commit | 6fc08d4f040c12de5dca6c54a0dffc7e434aeb7b (patch) | |
tree | a20fd79a9515cf2d0ec25e283d4ffc494ec57777 /usr.bin | |
parent | 62fc1b4a641d37a48a5d409872ac6d05dde89661 (diff) |
Added support for single file checkout.
OK joris@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/checkout.c | 20 | ||||
-rw-r--r-- | usr.bin/cvs/client.c | 6 |
2 files changed, 21 insertions, 5 deletions
diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c index 2d64d2fd11b..2b20fb351c0 100644 --- a/usr.bin/cvs/checkout.c +++ b/usr.bin/cvs/checkout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: checkout.c,v 1.99 2007/07/25 08:45:24 xsa Exp $ */ +/* $OpenBSD: checkout.c,v 1.100 2007/09/07 19:36:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -21,6 +21,7 @@ #include <errno.h> #include <fcntl.h> +#include <libgen.h> #include <string.h> #include <unistd.h> @@ -173,8 +174,21 @@ checkout_check_repository(int argc, char **argv) current_cvsroot->cr_dir, argv[i]); if (stat(repo, &st) == -1) { - cvs_log(LP_ERR, "cannot find module `%s' - ignored", - argv[i]); + /* check if a single file was requested */ + strlcat(repo, RCS_FILE_EXT, MAXPATHLEN); + + if (stat(repo, &st) == -1) { + cvs_log(LP_ERR, + "cannot find module `%s' - ignored", + argv[i]); + continue; + } + + cr.fileproc = cvs_update_local; + cr.flags = flags; + cvs_mkpath(dirname(argv[i]), cvs_specified_tag); + cvs_file_run(1, &(argv[i]), &cr); + continue; } diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index 0bfcfbdbd46..c93d95bbadc 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.76 2007/09/07 19:18:41 tobias Exp $ */ +/* $OpenBSD: client.c,v 1.77 2007/09/07 19:36:05 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -398,7 +398,9 @@ cvs_client_senddir(const char *dir) cvs_get_repository_path(dir, repo, MAXPATHLEN); - if (cvs_cmdop != CVS_OP_RLOG) + if (cvs_cmdop == CVS_OP_CHECKOUT && strcmp(dir, ".")) + return; + else if (cvs_cmdop != CVS_OP_RLOG) cvs_client_send_request("Directory %s\n%s", dir, repo); (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", |