Fossil SCM
Enhance the /reports page to include sub-categories "Merge Check-ins" and "Non-merge Check-ins".
Commit
d4058f78c90a8d8b6baa8e628e6d0128ccca0a2b51fbdc3bdbd7db9c7f3ad4fc
Parent
196dfedf7fc467c…
2 files changed
+37
-5
+6
-3
+37
-5
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -81,10 +81,20 @@ | ||
| 81 | 81 | case 'g': |
| 82 | 82 | case 'G': |
| 83 | 83 | zRealType = "g"; |
| 84 | 84 | rc = *zRealType; |
| 85 | 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; | |
| 86 | 96 | case 't': |
| 87 | 97 | case 'T': |
| 88 | 98 | zRealType = "t"; |
| 89 | 99 | rc = *zRealType; |
| 90 | 100 | break; |
| @@ -103,19 +113,28 @@ | ||
| 103 | 113 | " (event.mtime BETWEEN julianday(%Q) AND julianday(%Q))", |
| 104 | 114 | P("from"), P("to")); |
| 105 | 115 | }else{ |
| 106 | 116 | zTimeSpan = " 1"; |
| 107 | 117 | } |
| 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' ){ | |
| 109 | 123 | statsReportTimelineYFlag = zRealType; |
| 110 | 124 | db_multi_exec("CREATE TEMP VIEW v_reports AS " |
| 111 | 125 | "SELECT * FROM event WHERE (type GLOB %Q) AND %s", |
| 112 | 126 | zRealType, zTimeSpan/*safe-for-%s*/); |
| 113 | 127 | }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 | + ); | |
| 117 | 136 | } |
| 118 | 137 | return statsReportType = rc; |
| 119 | 138 | } |
| 120 | 139 | |
| 121 | 140 | /* |
| @@ -127,10 +146,14 @@ | ||
| 127 | 146 | static const char *stats_report_label_for_type(){ |
| 128 | 147 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 129 | 148 | switch( statsReportType ){ |
| 130 | 149 | case 'c': |
| 131 | 150 | return "check-ins"; |
| 151 | + case 'm': | |
| 152 | + return "merge check-ins"; | |
| 153 | + case 'n': | |
| 154 | + return "non-merge check-ins"; | |
| 132 | 155 | case 'e': |
| 133 | 156 | return "technotes"; |
| 134 | 157 | case 'f': |
| 135 | 158 | return "forum posts"; |
| 136 | 159 | case 'w': |
| @@ -825,11 +848,18 @@ | ||
| 825 | 848 | ** * byuser |
| 826 | 849 | ** * byfile |
| 827 | 850 | ** * lastchng |
| 828 | 851 | ** user=NAME Restricts statistics to the given user |
| 829 | 852 | ** 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) | |
| 831 | 861 | ** Defaulting to all event types. |
| 832 | 862 | ** |
| 833 | 863 | ** The view-specific query parameters include: |
| 834 | 864 | ** |
| 835 | 865 | ** view=byweek: |
| @@ -859,10 +889,12 @@ | ||
| 859 | 889 | }; |
| 860 | 890 | static const char *const azType[] = { |
| 861 | 891 | "a", "All Changes", |
| 862 | 892 | "ci", "Check-ins", |
| 863 | 893 | "f", "Forum Posts", |
| 894 | + "m", "Merge check-ins", | |
| 895 | + "n", "Non-merge check-ins", | |
| 864 | 896 | "g", "Tags", |
| 865 | 897 | "e", "Tech Notes", |
| 866 | 898 | "t", "Tickets", |
| 867 | 899 | "w", "Wiki" |
| 868 | 900 | }; |
| 869 | 901 |
| --- 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 |
+6
-3
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -33,13 +33,16 @@ | ||
| 33 | 33 | file used to be a symlink and has been replaced by a regular file. |
| 34 | 34 | (It previously checked for the inverse case only.) |
| 35 | 35 | * The [/help?cmd=empty-dirs|empty-dirs setting] now reuses the same |
| 36 | 36 | parser as the *-glob settings instead of its prior idiosyncratic |
| 37 | 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. | |
| 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> | |
| 41 | 44 | |
| 42 | 45 | <h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2> |
| 43 | 46 | * Users can request a password reset. This feature is disabledby default. Use |
| 44 | 47 | the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it. |
| 45 | 48 | New web pages [/help?cmd=/resetpw|/resetpw] and |
| 46 | 49 |
| --- 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 |