summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/server.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2009-04-04 11:29:58 +0000
committerJoris Vink <joris@cvs.openbsd.org>2009-04-04 11:29:58 +0000
commitf2cccafbbe264706cda47c7581c7880fecdb7231 (patch)
tree5f70ae3258c80ac15e12919df8b13d58f2a47ae0 /usr.bin/cvs/server.c
parent9be93bf1aef7d012bb298b2b2536fa7631b09c25 (diff)
properly expand modules if requested by the client,
this option is needed so gnu cvs clients can play along properly when running checkout <module> in a remote setup. if we do not support this, gnu cvs refuses to send us any existing files already on disk and opencvs will consider everything as NEEDS_CHECKOUT, instead of running an update on existing stuff. problem noticed by fgsch@ commited with opencvs, but please everybody else do not use opencvs to commit yet.
Diffstat (limited to 'usr.bin/cvs/server.c')
-rw-r--r--usr.bin/cvs/server.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c
index c2f381a8849..97024e21e19 100644
--- a/usr.bin/cvs/server.c
+++ b/usr.bin/cvs/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.95 2009/03/19 09:56:03 joris Exp $ */
+/* $OpenBSD: server.c,v 1.96 2009/04/04 11:29:57 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -820,3 +820,28 @@ cvs_server_clear_sticky(char *dir)
cvs_server_send_response("Clear-sticky %s//", dir);
cvs_remote_output(fpath);
}
+
+void
+cvs_server_exp_modules(char *module)
+{
+ struct module_checkout *mo;
+ struct cvs_filelist *fl;
+
+ if (server_argc != 2)
+ fatal("expand-modules with no arguments");
+
+ mo = cvs_module_lookup(server_argv[1]);
+
+ RB_FOREACH(fl, cvs_flisthead, &(mo->mc_modules))
+ cvs_server_send_response("Module-expansion %s", fl->file_path);
+ cvs_server_send_response("ok");
+
+ if (mo->mc_canfree == 1) {
+ xfree(mo->mc_name);
+ xfree(mo);
+ }
+
+ server_argc--;
+ xfree(server_argv[1]);
+ server_argv[1] = NULL;
+}