Check-in [cdbc3ab248]
Not logged in
Overview

SHA1 Hash:cdbc3ab2488b6eecffb398642f07dd50149a2ef3
Date: 2008-12-14 22:54:52
User: kejoki
Comment:Moved new tcksetup.c into checkout dir before commit, added rstats command to get stat page info from command line.
Timelines: ancestors | descendants | both | newcmd_rstatus | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/main.mk from [7596d8f2f4] to [1e02eecb11].

@@ -52,10 +52,11 @@
   $(SRCDIR)/pqueue.c \
   $(SRCDIR)/printf.c \
   $(SRCDIR)/rebuild.c \
   $(SRCDIR)/report.c \
   $(SRCDIR)/rss.c \
+  $(SRCDIR)/rstats.c \
   $(SRCDIR)/schema.c \
   $(SRCDIR)/setup.c \
   $(SRCDIR)/sha1.c \
   $(SRCDIR)/shun.c \
   $(SRCDIR)/stat.c \
@@ -119,10 +120,11 @@
   pqueue_.c \
   printf_.c \
   rebuild_.c \
   report_.c \
   rss_.c \
+  rstats_.c \
   schema_.c \
   setup_.c \
   sha1_.c \
   shun_.c \
   stat_.c \
@@ -186,10 +188,11 @@
   pqueue.o \
   printf.o \
   rebuild.o \
   report.o \
   rss.o \
+  rstats.o \
   schema.o \
   setup.o \
   sha1.o \
   shun.o \
   stat.o \
@@ -252,16 +255,16 @@
 	# noop
 
 clean:
 	rm -f *.o *_.c $(APPNAME) VERSION.h
 	rm -f translate makeheaders mkindex page_index.h headers
-	rm -f add.h admin.h allrepo.h bag.h blob.h branch.h browse.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h construct.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h file.h http.h info.h login.h main.h manifest.h md5.h merge.h merge3.h my_page.h name.h pivot.h pqueue.h printf.h rebuild.h report.h rss.h schema.h setup.h sha1.h shun.h stat.h style.h sync.h tag.h tagview.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h
+	rm -f add.h admin.h allrepo.h bag.h blob.h branch.h browse.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h construct.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h file.h http.h info.h login.h main.h manifest.h md5.h merge.h merge3.h my_page.h name.h pivot.h pqueue.h printf.h rebuild.h report.h rss.h rstats.h schema.h setup.h sha1.h shun.h stat.h style.h sync.h tag.h tagview.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h
 
 page_index.h: $(TRANS_SRC) mkindex
 	./mkindex $(TRANS_SRC) >$@
 headers:	page_index.h makeheaders VERSION.h
-	./makeheaders  add_.c:add.h admin_.c:admin.h allrepo_.c:allrepo.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h my_page_.c:my_page.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tagview_.c:tagview.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h
+	./makeheaders  add_.c:add.h admin_.c:admin.h allrepo_.c:allrepo.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h http_.c:http.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h my_page_.c:my_page.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h rstats_.c:rstats.h schema_.c:schema.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tagview_.c:tagview.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h
 	touch headers
 headers: Makefile
 Makefile:
 add_.c:	$(SRCDIR)/add.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/add.c | sed -f $(SRCDIR)/VERSION >add_.c
@@ -548,10 +551,17 @@
 
 rss.o:	rss_.c rss.h  $(SRCDIR)/config.h
 	$(XTCC) -o rss.o -c rss_.c
 
 rss.h:	headers
+rstats_.c:	$(SRCDIR)/rstats.c $(SRCDIR)/VERSION translate
+	./translate $(SRCDIR)/rstats.c | sed -f $(SRCDIR)/VERSION >rstats_.c
+
+rstats.o:	rstats_.c rstats.h  $(SRCDIR)/config.h
+	$(XTCC) -o rstats.o -c rstats_.c
+
+rstats.h:	headers
 schema_.c:	$(SRCDIR)/schema.c $(SRCDIR)/VERSION translate
 	./translate $(SRCDIR)/schema.c | sed -f $(SRCDIR)/VERSION >schema_.c
 
 schema.o:	schema_.c schema.h  $(SRCDIR)/config.h
 	$(XTCC) -o schema.o -c schema_.c

Modified src/makemake.tcl from [04f9771b04] to [aa8817088a].

@@ -46,10 +46,11 @@
   pqueue
   printf
   rebuild
   report
   rss
+  rstats
   schema
   setup
   sha1
   shun
   stat

Added src/rstats.c version [c966630d30]

@@ -1,1 +1,82 @@
+/*
+** Copyright (c) 2008 D. Richard Hipp, Kevin Kinnell
+**
+** This program is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public
+** License version 2 as published by the Free Software Foundation.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+** General Public License for more details.
+**
+** You should have received a copy of the GNU General Public
+** License along with this library; if not, write to the
+** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+** Boston, MA  02111-1307, USA.
+**
+** Author contact information:
+**   drh@hwaci.com
+**   http://www.hwaci.com/drh/
+**
+**   kkinnell@megagate.com
+**
+*******************************************************************************
+**
+** This file contains code to implement the metrics command.  This is a
+** command-line version of the stats page.
+**
+*/
+#include <string.h>
+#include "config.h"
+#include "metrics.h"
+
+/*
+** COMMAND: rstats
+**
+** Usage: %fossil rstats
+**
+** Deliver a report of the repository statistics for the
+** current checkout.
+*/
+void rstats_cmd(void){
+  i64 t;
+  int n, m, fsize, vid;
+  char zBuf[100];
 
+  db_must_be_within_tree();
+  vid = db_lget_int("checkout",0);
+  if( vid==0 ){
+    fossil_panic("no checkout");
+  }
+  fsize = file_size(g.zRepositoryName);
+  n = db_int(0, "SELECT count(*) FROM blob");
+  m = db_int(0, "SELECT count(*) FROM delta");
+  printf(" Number of Artifacts: %d\n", n);
+  printf("  %d full text + %d delta blobs\n", (n-m), m);
+  if( n>0 ){
+    int a, b;
+    t = db_int64(0, "SELECT total(size) FROM blob WHERE size>0");
+    sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", t);
+    if( t/fsize < 5 ){
+      b = 10;
+      fsize /= 10;
+    }else{
+      b = 1;
+    }
+    a = t/fsize;
+    printf(" %d bytes average, %s bytes total\n\n",
+	   ((int)(((double)t)/(double)n)),
+	   (zBuf));
+  }
+  n = db_int(0, "SELECT count(distinct mid) FROM mlink");
+  printf("  Number Of Checkins: %d\n", n);
+  n = db_int(0, "SELECT count(*) FROM filename");
+  printf("     Number Of Files: %d\n", n);
+  n = db_int(0, "SELECT count(*) FROM tag WHERE +tagname GLOB 'wiki-*'");
+  printf("Number Of Wiki Pages: %d\n", n);
+  n = db_int(0, "SELECT count(*) FROM tag WHERE +tagname GLOB 'tkt-*'");
+  printf("   Number Of Tickets: %d\n", n);
+  n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event) + 0.99");
+  printf(" Duration Of Project: %d days\n", n);
+}

Modified src/tktsetup.c from [893b046bc6] to [8063829836].

@@ -198,17 +198,19 @@
 @ }
 @ set resolution_choices {
 @   Open
 @   Fixed
 @   Rejected
+@   Workaround
 @   Unable_To_Reproduce
 @   Works_As_Designed
 @   External_Bug
 @   Not_A_Bug
 @   Duplicate
 @   Overcome_By_Events
 @   Drive_By_Patch
+@   Misconfiguration
 @ }
 @ set status_choices {
 @   Open
 @   Verified
 @   Review