// commitlog-html.js var start=new Date(); load("sbbsdefs.js"); var max_msgs = 500; var log_msgs = 0; var author_list = []; if(this.env && env["QUERY_STRING"]) if(!isNaN(val=parseInt(env["QUERY_STRING"]))) max_msgs=val; if(this.http_request && http_request.query_string) if(!isNaN(val=parseInt(http_request.query_string))) max_msgs=val; if(this.server==undefined) { /* CGI, so send CGI/HTTP headers */ writeln("Content-Type: text/html"); writeln(); } var viewcvs_cgi = "http://cvs.synchro.net/cgi-bin/viewcvs.cgi/"; var markup = "&content-type=text/vnd.viewcvs-markup"; // HTML Header writeln(""); writeln(""); writeln("Synchronet CVS Commit Log"); writeln(""); writeln(""); writeln(""); writeln(""); writeln("

Synchronet CVS Commit Log

"); desc="This is a log of the " + String(max_msgs).italics() + " most recent changes in the " + "Synchronet".link("http://www.synchro.net") + " CVS " + "repository".link(viewcvs_cgi) + "."; writeln(desc.fontcolor("white")); writeln("
"); msgbase = new MsgBase("syncprog"); if(!msgbase.open()) { writeln("!ERROR Opening Message Base: " + msgbase.error); exit(); } writeln("
    "); var path_re = /(\S+)/; var files_re = / ([^\s,]+,[^\s,]+,\S+)/g; var no_files_re = / ([^\s ]+ [^\s ]+ \d\S+)/g; var parm_re = /\s+([^,]+),([^,]+),(\S+)/; var parm_re2 = /\s+([^ ]+) ([^ ]+) (\S+)/; for(offset=msgbase.total_msgs-1;offset>=0 && log_msgs"); writeln("
  1. " + hdr.from.bold().fontcolor("yellow") + "
    "); writeln("" + system.timestr(hdr.when_written_time) + " " + system.zonestr(hdr.when_written_zone) + ""); writeln(""); if(author_list[hdr.from]==undefined) author_list[hdr.from] = {commits: 0, latest: 0}; author_list[hdr.from].commits++; if(author_list[hdr.from].latest < hdr.when_written_time) author_list[hdr.from].latest = hdr.when_written_time; if((body=msgbase.get_msg_body(hdr))) { line=body.split("\r\n"); path=line[0].match(path_re)[1]+"/"; files=line[0].match(files_re); if(!files) files=line[0].match(no_files_re); if(files) { line.splice(0,4); /* Ignore first 4 lines */ writeln("

    " + line.shift().fixed()); // "Modified Files:" while((str=line.shift()).charAt(0)=='\t') ; line.unshift(str); writeln(""); for(f=0;f"); var parm = files[f].match(parm_re); if(!parm) parm = files[f].match(parm_re2); var fname = parm[1]; var oldrev = parm[2]; var newrev = parm[3]; writeln("
    "+path.fixed().link(viewcvs_cgi+path) +fname.fixed().link(viewcvs_cgi+path+fname)); writeln(""+oldrev.link(viewcvs_cgi+path+fname+"?rev="+oldrev+markup)); writeln(""+newrev.link(viewcvs_cgi+path+fname+"?rev="+newrev+markup)); writeln(""+"diff".link(viewcvs_cgi+path+fname+".diff?r1="+oldrev+"&r2="+newrev)); } writeln("
    "); //line.splice(0,4); /* Ignore first 4 lines */ //writeln("
    " + line.shift().fixed()); // "Log Message: " } writeln("

    " + html_encode(truncsp(line.join("\r\n"))
    			,true,false,false,false) + "
    "); } log_msgs++; } msgbase.close(); writeln("
"); writeln(""); writeln("
AuthorCommitsLatest"); for(i in author_list) write("
" + i + "" + author_list[i].commits + "" + system.timestr(author_list[i].latest)); writeln("
"); write("
Dynamically generated "); write(format("in %lu milliseconds ", new Date().valueOf()-start.valueOf())); writeln(""); writeln(""); /* End of commit-html.js */