Index: cvstools/trigger_interface.h =================================================================== RCS file: /cvs/cvsnt/cvstools/trigger_interface.h,v retrieving revision 1.1.2.8.4.5 diff -c -r1.1.2.8.4.5 trigger_interface.h *** cvstools/trigger_interface.h 5 Sep 2008 04:38:13 -0000 1.1.2.8.4.5 --- cvstools/trigger_interface.h 5 Sep 2008 05:36:23 -0000 *************** *** 62,67 **** --- 62,68 ---- int (*precommit)(const struct trigger_interface_t* cb, int name_list_count, const char **name_list, const char *message, const char *directory, const char *bugs); int (*postcommit)(const struct trigger_interface_t* cb, const char *directory); int (*precommand)(const struct trigger_interface_t* cb, int argc, const char **argv); + int (*ls)(const struct trigger_interface_t* cb, const char *audit_user, const char *audit_param, int argc, const char **argv); int (*plugintools)(const struct trigger_interface_t* cb, void *param); int (*postcommand)(const struct trigger_interface_t* cb, const char *directory, int return_code); int (*premodule)(const struct trigger_interface_t* cb, const char *module); Index: src/cvs.h =================================================================== RCS file: /cvs/cvsnt/src/cvs.h,v retrieving revision 1.93.2.208.6.14 diff -c -r1.93.2.208.6.14 cvs.h *** src/cvs.h 5 Sep 2008 04:38:13 -0000 1.93.2.208.6.14 --- src/cvs.h 5 Sep 2008 05:36:23 -0000 *************** *** 1180,1185 **** --- 1180,1196 ---- int plugintools_proc(void *param, const trigger_interface *cb); + /* Information passed to precommand_proc. Also called by client in local mode */ + struct ls_args_t + { + int argc; + const char **argv; + const char *audit_user; + const char *audit_param; + int retval; + }; + int ls_proc(void *param, const trigger_interface *cb); + /* Last repository called if any recursion was done */ extern const char *last_repository; Index: src/ls.cpp =================================================================== RCS file: /cvs/cvsnt/src/ls.c,v retrieving revision 1.14.2.33.6.1 diff -c -r1.14.2.33.6.1 ls.cpp *** src/ls.cpp 20 May 2008 22:44:54 -0000 1.14.2.33.6.1 --- src/ls.cpp 5 Sep 2008 03:39:31 -0000 *************** *** 14,20 **** // Horrid hack for legacy servers unsigned global_ls_response_hack; ! static int ls_proc (int argc, char **argv, const char *xwhere, const char *mwhere, const char *mfile, int shorten, int local, const char *mname, const char *msg); static int ls_fileproc(void *callerdat, struct file_info *finfo); static Dtype ls_direntproc(void *callerdat, char *dir, char *repos, char *update_dir, --- 14,20 ---- // Horrid hack for legacy servers unsigned global_ls_response_hack; ! static int rls_proc (int argc, char **argv, const char *xwhere, const char *mwhere, const char *mfile, int shorten, int local, const char *mname, const char *msg); static int ls_fileproc(void *callerdat, struct file_info *finfo); static Dtype ls_direntproc(void *callerdat, char *dir, char *repos, char *update_dir, *************** *** 22,28 **** --- 22,31 ---- static const char *const ls_usage[] = { + // "Usage: %s %s [-q] [-e] [-l] [-R] [-a audit-report] [-u audit-user] [-r rev] [-D date] [-t] [modules...]\n", "Usage: %s %s [-q] [-e] [-l] [-R] [-r rev] [-D date] [-t] [modules...]\n", + // "\t-a audit-report\t\n", + // "\t-u audit-user\t\n", "\t-D date\tShow files from date.\n", "\t-e\tDisplay in CVS/Entries format.\n", "\t-l\tDisplay all details.\n", *************** *** 37,42 **** --- 40,48 ---- static int entries_format; static int long_format; + static int audit_format; + static char *show_audit; + static char *show_audit_user; static char *show_tag; static char *show_date; static int tag_validated; *************** *** 55,62 **** --- 61,71 ---- if (argc == -1) usage (ls_usage); + audit_format = 0; entries_format = 0; long_format = 0; + show_audit_user = NULL; + show_audit = NULL; show_tag = NULL; show_date = NULL; tag_validated = 0; *************** *** 66,72 **** local_time_offset = get_local_time_offset(); optind = 0; ! while ((c = getopt (argc, argv, "+qelr:D:RTo:P")) != -1) { switch (c) { --- 75,81 ---- local_time_offset = get_local_time_offset(); optind = 0; ! while ((c = getopt (argc, argv, "+qelr:D:RTo:a:u:P")) != -1) { switch (c) { *************** *** 79,84 **** --- 88,101 ---- case 'l': long_format = 1; break; + case 'a': + quiet = 1; + audit_format = 1; + show_audit = optarg; + break; + case 'u': + show_audit_user = optarg; + break; case 'r': show_tag = optarg; break; *************** *** 164,169 **** --- 181,190 ---- sprintf(tmp,"%d",local_time_offset); option_with_arg("-o",tmp); } + if(show_audit_user) + option_with_arg("-u",show_audit_user); + if(show_audit) + option_with_arg("-a",show_audit); if(show_tag) option_with_arg("-r",show_tag); if(show_date) *************** *** 253,259 **** err += do_module (db, mod, MISC, "Listing", ! ls_proc, (char *) NULL, 0, 0, 0, 0, (char*)NULL); xfree(mod); } --- 274,280 ---- err += do_module (db, mod, MISC, "Listing", ! rls_proc, (char *) NULL, 0, 0, 0, 0, (char*)NULL); xfree(mod); } *************** *** 262,268 **** { err += do_module (db, ".", MISC, "Listing", ! ls_proc, (char *) NULL, 0, 0, 0, 0, (char*)NULL); } close_module (db); } --- 283,289 ---- { err += do_module (db, ".", MISC, "Listing", ! rls_proc, (char *) NULL, 0, 0, 0, 0, (char*)NULL); } close_module (db); } *************** *** 270,276 **** return (err); } ! static int ls_proc (int argc, char **argv, const char *xwhere, const char *mwhere, const char *mfile, int shorten, int local, const char *mname, const char *msg) { /* Begin section which is identical to patch_proc--should this be abstracted out somehow? */ --- 291,297 ---- return (err); } ! static int rls_proc (int argc, char **argv, const char *xwhere, const char *mwhere, const char *mfile, int shorten, int local, const char *mname, const char *msg) { /* Begin section which is identical to patch_proc--should this be abstracted out somehow? */ *************** *** 360,365 **** --- 381,388 ---- tag_validated = 1; } + if (!audit_format) + { err = start_recursion (ls_fileproc, (FILESDONEPROC) NULL,(PREDIRENTPROC) NULL, ls_direntproc, (DIRLEAVEPROC) NULL, NULL, argc - 1, argv + 1, local, which, 0, 1, *************** *** 380,385 **** --- 403,415 ---- } close_module(db); } + } + } + else + { + // audit + err = 0; + server_ls(show_audit_user, show_audit, argc, (const char **)argv); } return err; } Index: src/server.cpp =================================================================== RCS file: /cvs/cvsnt/src/server.c,v retrieving revision 1.106.2.210.6.61 diff -c -r1.106.2.210.6.61 server.cpp *** src/server.cpp 4 Jun 2008 06:13:04 -0000 1.106.2.210.6.61 --- src/server.cpp 5 Sep 2008 03:37:59 -0000 *************** *** 5011,5016 **** --- 5011,5027 ---- run_trigger(&data,template_proc); } + void server_ls(const char *audit_user, const char *audit_param, int argc, const char **argv) + { + ls_args_t xxxx; + xxxx.audit_user=audit_user; + xxxx.audit_param=audit_param; + xxxx.argc=argc; + xxxx.argv=argv; + TRACE(3,"run ls proc server"); + run_trigger(&xxxx, ls_proc); + } + static void serve_gzip_stream (char *arg) { int level; *************** *** 7081,7086 **** --- 7092,7109 ---- if(cb->precommand) ret = cb->precommand(cb,args->argc,args->argv); + return ret; + } + + int ls_proc(void *param, const trigger_interface *cb) + { + int ret = 0; + ls_args_t *args = (ls_args_t*)param; + + TRACE(1,"ls_proc()"); + + if(cb->ls) + ret = cb->ls(cb,args->audit_user,args->audit_param,args->argc,args->argv); return ret; } Index: src/server.h =================================================================== RCS file: /cvs/cvsnt/src/server.h,v retrieving revision 1.17.2.25.6.2 diff -c -r1.17.2.25.6.2 server.h *** src/server.h 14 Jun 2007 03:40:37 -0000 1.17.2.25.6.2 --- src/server.h 5 Sep 2008 03:59:59 -0000 *************** *** 115,120 **** --- 115,123 ---- void server_set_sticky (const char *update_dir, const char *repository, const char *tag, const char *date, int nonbranch, const char *version); /* Send Template response. */ void server_template (const char *update_dir, const char *repository); + /* Send RLS Audit response. */ + void server_ls(const char *audit_user, const char *audit_param, int argc, const char **argv); + void server_update_entries (const char *file, const char *update_dir, const char *repository, enum server_updated_arg4 updated); *************** *** 134,139 **** --- 137,143 ---- #else /* !SERVER_SUPPORT */ static void server_template (const char *update_dir, const char *repository) { }; + static void server_ls(const char *audit_user, const char *audit_param, int argc, const char **argv) {}; #endif /* SERVER_SUPPORT */ Index: triggers/audit_trigger.cpp =================================================================== RCS file: /cvs/cvsnt/triggers/audit_trigger.cpp,v retrieving revision 1.1.2.33.4.39 diff -c -r1.1.2.33.4.39 audit_trigger.cpp *** triggers/audit_trigger.cpp 5 Sep 2008 04:38:13 -0000 1.1.2.33.4.39 --- triggers/audit_trigger.cpp 5 Sep 2008 05:43:48 -0000 *************** *** 555,560 **** --- 555,568 ---- return 0; } + int lsaudit(const struct trigger_interface_t* cb, const char *audit_user, const char *audit_param, int argc, const char **argv) + { + //cvs_outerr("Listing module: ", 0); + printf("No audit results for \"%s\" user \"%s\" argc=%d\n",(audit_param)?audit_param:"*none*",(audit_user)?audit_user:"*noone*",argc); + + return 0; + } + int plugintoolsaudit(const struct trigger_interface_t* cb, void *param) { return 0; *************** *** 686,691 **** --- 694,700 ---- precommitaudit, postcommitaudit, precommandaudit, + lsaudit, plugintoolsaudit, postcommandaudit, premoduleaudit, Index: triggers/checkout_trigger.cpp =================================================================== RCS file: /cvs/cvsnt/triggers/checkout_trigger.cpp,v retrieving revision 1.1.2.16.4.8 diff -c -r1.1.2.16.4.8 checkout_trigger.cpp *** triggers/checkout_trigger.cpp 1 May 2008 23:21:22 -0000 1.1.2.16.4.8 --- triggers/checkout_trigger.cpp 5 Sep 2008 03:37:58 -0000 *************** *** 167,172 **** --- 167,177 ---- return 0; } + int lscheckout(const struct trigger_interface_t* cb, const char *audit_user, const char *audit_param, int argc, const char **argv) + { + return 0; + } + int plugintoolscheckout(const struct trigger_interface_t* cb, void *param) { return 0; *************** *** 413,418 **** --- 418,424 ---- precommitcheckout, postcommitcheckout, precommandcheckout, + lscheckout, plugintoolscheckout, postcommandcheckout, premodulecheckout, Index: triggers/email_trigger.cpp =================================================================== RCS file: /cvs/cvsnt/triggers/email_trigger.cpp,v retrieving revision 1.1.2.26.4.6 diff -c -r1.1.2.26.4.6 email_trigger.cpp *** triggers/email_trigger.cpp 1 May 2008 23:21:22 -0000 1.1.2.26.4.6 --- triggers/email_trigger.cpp 5 Sep 2008 03:37:58 -0000 *************** *** 341,346 **** --- 341,351 ---- return 0; } + int lsemail(const struct trigger_interface_t* cb, const char *audit_user, const char *audit_param, int argc, const char **argv) + { + return 0; + } + int plugintoolsemail(const struct trigger_interface_t* cb, void *param) { return 0; *************** *** 806,811 **** --- 811,817 ---- precommitemail, postcommitemail, precommandemail, + lsemail, plugintoolsemail, postcommandemail, premoduleemail, Index: triggers/info_trigger.cpp =================================================================== RCS file: /cvs/cvsnt/triggers/info_trigger.cpp,v retrieving revision 1.1.2.82.4.14 diff -c -r1.1.2.82.4.14 info_trigger.cpp *** triggers/info_trigger.cpp 28 May 2008 03:41:11 -0000 1.1.2.82.4.14 --- triggers/info_trigger.cpp 5 Sep 2008 03:37:58 -0000 *************** *** 790,795 **** --- 790,799 ---- return parse_info(CVSROOT_PRECOMMAND,"%r %c","%