Fossil SCM

Enhance the /reports page to include sub-categories "Merge Check-ins" and "Non-merge Check-ins".

drh 2023-05-29 12:44 trunk merge
Commit d4058f78c90a8d8b6baa8e628e6d0128ccca0a2b51fbdc3bdbd7db9c7f3ad4fc
2 files changed +37 -5 +6 -3
+37 -5
--- src/statrep.c
+++ src/statrep.c
@@ -81,10 +81,20 @@
8181
case 'g':
8282
case 'G':
8383
zRealType = "g";
8484
rc = *zRealType;
8585
break;
86
+ case 'm':
87
+ case 'M':
88
+ zRealType = "m";
89
+ rc = *zRealType;
90
+ break;
91
+ case 'n':
92
+ case 'N':
93
+ zRealType = "n";
94
+ rc = *zRealType;
95
+ break;
8696
case 't':
8797
case 'T':
8898
zRealType = "t";
8999
rc = *zRealType;
90100
break;
@@ -103,19 +113,28 @@
103113
" (event.mtime BETWEEN julianday(%Q) AND julianday(%Q))",
104114
P("from"), P("to"));
105115
}else{
106116
zTimeSpan = " 1";
107117
}
108
- if(zRealType){
118
+ if( zRealType==0 ){
119
+ statsReportTimelineYFlag = "a";
120
+ db_multi_exec("CREATE TEMP VIEW v_reports AS "
121
+ "SELECT * FROM event WHERE %s", zTimeSpan/*safe-for-%s*/);
122
+ }else if( rc!='n' && rc!='m' ){
109123
statsReportTimelineYFlag = zRealType;
110124
db_multi_exec("CREATE TEMP VIEW v_reports AS "
111125
"SELECT * FROM event WHERE (type GLOB %Q) AND %s",
112126
zRealType, zTimeSpan/*safe-for-%s*/);
113127
}else{
114
- statsReportTimelineYFlag = "a";
115
- db_multi_exec("CREATE TEMP VIEW v_reports AS "
116
- "SELECT * FROM event WHERE %s", zTimeSpan/*safe-for-%s*/);
128
+ const char *zNot = rc=='n' ? "NOT" : "";
129
+ statsReportTimelineYFlag = "ci";
130
+ db_multi_exec(
131
+ "CREATE TEMP VIEW v_reports AS "
132
+ "SELECT * FROM event WHERE type='ci' AND %s"
133
+ " AND objid %s IN (SELECT cid FROM plink WHERE NOT isprim)",
134
+ zTimeSpan/*safe-for-%s*/, zNot/*safe-for-%s*/
135
+ );
117136
}
118137
return statsReportType = rc;
119138
}
120139
121140
/*
@@ -127,10 +146,14 @@
127146
static const char *stats_report_label_for_type(){
128147
assert( statsReportType && "Must call stats_report_init_view() first." );
129148
switch( statsReportType ){
130149
case 'c':
131150
return "check-ins";
151
+ case 'm':
152
+ return "merge check-ins";
153
+ case 'n':
154
+ return "non-merge check-ins";
132155
case 'e':
133156
return "technotes";
134157
case 'f':
135158
return "forum posts";
136159
case 'w':
@@ -825,11 +848,18 @@
825848
** * byuser
826849
** * byfile
827850
** * lastchng
828851
** user=NAME Restricts statistics to the given user
829852
** type=TYPE Restricts the report to a specific event type:
830
-** ci (check-in), f (forum), w (wiki), t (ticket), g (tag)
853
+** * all (everything),
854
+** * ci (check-in)
855
+** * m (merge check-in),
856
+** * n (non-merge check-in)
857
+** * f (forum post)
858
+** * w (wiki page change)
859
+** * t (ticket change)
860
+** * g (tag added or removed)
831861
** Defaulting to all event types.
832862
**
833863
** The view-specific query parameters include:
834864
**
835865
** view=byweek:
@@ -859,10 +889,12 @@
859889
};
860890
static const char *const azType[] = {
861891
"a", "All Changes",
862892
"ci", "Check-ins",
863893
"f", "Forum Posts",
894
+ "m", "Merge check-ins",
895
+ "n", "Non-merge check-ins",
864896
"g", "Tags",
865897
"e", "Tech Notes",
866898
"t", "Tickets",
867899
"w", "Wiki"
868900
};
869901
--- src/statrep.c
+++ src/statrep.c
@@ -81,10 +81,20 @@
81 case 'g':
82 case 'G':
83 zRealType = "g";
84 rc = *zRealType;
85 break;
 
 
 
 
 
 
 
 
 
 
86 case 't':
87 case 'T':
88 zRealType = "t";
89 rc = *zRealType;
90 break;
@@ -103,19 +113,28 @@
103 " (event.mtime BETWEEN julianday(%Q) AND julianday(%Q))",
104 P("from"), P("to"));
105 }else{
106 zTimeSpan = " 1";
107 }
108 if(zRealType){
 
 
 
 
109 statsReportTimelineYFlag = zRealType;
110 db_multi_exec("CREATE TEMP VIEW v_reports AS "
111 "SELECT * FROM event WHERE (type GLOB %Q) AND %s",
112 zRealType, zTimeSpan/*safe-for-%s*/);
113 }else{
114 statsReportTimelineYFlag = "a";
115 db_multi_exec("CREATE TEMP VIEW v_reports AS "
116 "SELECT * FROM event WHERE %s", zTimeSpan/*safe-for-%s*/);
 
 
 
 
 
117 }
118 return statsReportType = rc;
119 }
120
121 /*
@@ -127,10 +146,14 @@
127 static const char *stats_report_label_for_type(){
128 assert( statsReportType && "Must call stats_report_init_view() first." );
129 switch( statsReportType ){
130 case 'c':
131 return "check-ins";
 
 
 
 
132 case 'e':
133 return "technotes";
134 case 'f':
135 return "forum posts";
136 case 'w':
@@ -825,11 +848,18 @@
825 ** * byuser
826 ** * byfile
827 ** * lastchng
828 ** user=NAME Restricts statistics to the given user
829 ** type=TYPE Restricts the report to a specific event type:
830 ** ci (check-in), f (forum), w (wiki), t (ticket), g (tag)
 
 
 
 
 
 
 
831 ** Defaulting to all event types.
832 **
833 ** The view-specific query parameters include:
834 **
835 ** view=byweek:
@@ -859,10 +889,12 @@
859 };
860 static const char *const azType[] = {
861 "a", "All Changes",
862 "ci", "Check-ins",
863 "f", "Forum Posts",
 
 
864 "g", "Tags",
865 "e", "Tech Notes",
866 "t", "Tickets",
867 "w", "Wiki"
868 };
869
--- src/statrep.c
+++ src/statrep.c
@@ -81,10 +81,20 @@
81 case 'g':
82 case 'G':
83 zRealType = "g";
84 rc = *zRealType;
85 break;
86 case 'm':
87 case 'M':
88 zRealType = "m";
89 rc = *zRealType;
90 break;
91 case 'n':
92 case 'N':
93 zRealType = "n";
94 rc = *zRealType;
95 break;
96 case 't':
97 case 'T':
98 zRealType = "t";
99 rc = *zRealType;
100 break;
@@ -103,19 +113,28 @@
113 " (event.mtime BETWEEN julianday(%Q) AND julianday(%Q))",
114 P("from"), P("to"));
115 }else{
116 zTimeSpan = " 1";
117 }
118 if( zRealType==0 ){
119 statsReportTimelineYFlag = "a";
120 db_multi_exec("CREATE TEMP VIEW v_reports AS "
121 "SELECT * FROM event WHERE %s", zTimeSpan/*safe-for-%s*/);
122 }else if( rc!='n' && rc!='m' ){
123 statsReportTimelineYFlag = zRealType;
124 db_multi_exec("CREATE TEMP VIEW v_reports AS "
125 "SELECT * FROM event WHERE (type GLOB %Q) AND %s",
126 zRealType, zTimeSpan/*safe-for-%s*/);
127 }else{
128 const char *zNot = rc=='n' ? "NOT" : "";
129 statsReportTimelineYFlag = "ci";
130 db_multi_exec(
131 "CREATE TEMP VIEW v_reports AS "
132 "SELECT * FROM event WHERE type='ci' AND %s"
133 " AND objid %s IN (SELECT cid FROM plink WHERE NOT isprim)",
134 zTimeSpan/*safe-for-%s*/, zNot/*safe-for-%s*/
135 );
136 }
137 return statsReportType = rc;
138 }
139
140 /*
@@ -127,10 +146,14 @@
146 static const char *stats_report_label_for_type(){
147 assert( statsReportType && "Must call stats_report_init_view() first." );
148 switch( statsReportType ){
149 case 'c':
150 return "check-ins";
151 case 'm':
152 return "merge check-ins";
153 case 'n':
154 return "non-merge check-ins";
155 case 'e':
156 return "technotes";
157 case 'f':
158 return "forum posts";
159 case 'w':
@@ -825,11 +848,18 @@
848 ** * byuser
849 ** * byfile
850 ** * lastchng
851 ** user=NAME Restricts statistics to the given user
852 ** type=TYPE Restricts the report to a specific event type:
853 ** * all (everything),
854 ** * ci (check-in)
855 ** * m (merge check-in),
856 ** * n (non-merge check-in)
857 ** * f (forum post)
858 ** * w (wiki page change)
859 ** * t (ticket change)
860 ** * g (tag added or removed)
861 ** Defaulting to all event types.
862 **
863 ** The view-specific query parameters include:
864 **
865 ** view=byweek:
@@ -859,10 +889,12 @@
889 };
890 static const char *const azType[] = {
891 "a", "All Changes",
892 "ci", "Check-ins",
893 "f", "Forum Posts",
894 "m", "Merge check-ins",
895 "n", "Non-merge check-ins",
896 "g", "Tags",
897 "e", "Tech Notes",
898 "t", "Tickets",
899 "w", "Wiki"
900 };
901
--- www/changes.wiki
+++ www/changes.wiki
@@ -33,13 +33,16 @@
3333
file used to be a symlink and has been replaced by a regular file.
3434
(It previously checked for the inverse case only.)
3535
* The [/help?cmd=empty-dirs|empty-dirs setting] now reuses the same
3636
parser as the *-glob settings instead of its prior idiosyncratic
3737
parser, allowing quoted whitespace in patterns.
38
- * The by-week, by-month, and by-year options of the
39
- [/help?cmd=/reports|/reports webpage] now show an estimated ultimate
40
- size of the current week, month, or year as a dashed box.
38
+ * Enhancements to the [/help?cmd=/reports|/reports webpage]:
39
+ <ol type="a">
40
+ <li> The by-week, by-month, and by-year options now show an estimated
41
+ size of the current week, month, or year as a dashed box.
42
+ <li> New sub-categories "Merge Check-ins" and "Non-Merge Check-ins".
43
+ </ol>
4144
4245
<h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2>
4346
* Users can request a password reset. This feature is disabledby default. Use
4447
the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it.
4548
New web pages [/help?cmd=/resetpw|/resetpw] and
4649
--- www/changes.wiki
+++ www/changes.wiki
@@ -33,13 +33,16 @@
33 file used to be a symlink and has been replaced by a regular file.
34 (It previously checked for the inverse case only.)
35 * The [/help?cmd=empty-dirs|empty-dirs setting] now reuses the same
36 parser as the *-glob settings instead of its prior idiosyncratic
37 parser, allowing quoted whitespace in patterns.
38 * The by-week, by-month, and by-year options of the
39 [/help?cmd=/reports|/reports webpage] now show an estimated ultimate
40 size of the current week, month, or year as a dashed box.
 
 
 
41
42 <h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2>
43 * Users can request a password reset. This feature is disabledby default. Use
44 the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it.
45 New web pages [/help?cmd=/resetpw|/resetpw] and
46
--- www/changes.wiki
+++ www/changes.wiki
@@ -33,13 +33,16 @@
33 file used to be a symlink and has been replaced by a regular file.
34 (It previously checked for the inverse case only.)
35 * The [/help?cmd=empty-dirs|empty-dirs setting] now reuses the same
36 parser as the *-glob settings instead of its prior idiosyncratic
37 parser, allowing quoted whitespace in patterns.
38 * Enhancements to the [/help?cmd=/reports|/reports webpage]:
39 <ol type="a">
40 <li> The by-week, by-month, and by-year options now show an estimated
41 size of the current week, month, or year as a dashed box.
42 <li> New sub-categories "Merge Check-ins" and "Non-Merge Check-ins".
43 </ol>
44
45 <h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2>
46 * Users can request a password reset. This feature is disabledby default. Use
47 the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it.
48 New web pages [/help?cmd=/resetpw|/resetpw] and
49

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button