Fossil

Check-in [d4058f78]
Login

Check-in [d4058f78]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enhance the /reports page to include sub-categories "Merge Check-ins" and "Non-merge Check-ins".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d4058f78c90a8d8b6baa8e628e6d0128ccca0a2b51fbdc3bdbd7db9c7f3ad4fc
User & Date: drh 2023-05-29 12:44:57
Context
2023-05-31
15:26
Version 2.22 ... (check-in: 66ee0beb user: drh tags: trunk, release, version-2.22)
2023-05-29
12:44
Enhance the /reports page to include sub-categories "Merge Check-ins" and "Non-merge Check-ins". ... (check-in: d4058f78 user: drh tags: trunk)
12:44
Improved documentation for the /reports page. Add the latest /reports enhancements to the change log. ... (Closed-Leaf check-in: f71657d5 user: drh tags: non-merge-activity-report)
2023-05-27
15:54
Do not allow non-alpha numeric ascii characters into the search pattern. Convert all such characters into a single space. ... (check-in: 196dfedf user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/statrep.c.

79
80
81
82
83
84
85










86
87
88
89
90
91
92
      rc = *zRealType;
      break;
    case 'g':
    case 'G':
      zRealType = "g";
      rc = *zRealType;
      break;










    case 't':
    case 'T':
      zRealType = "t";
      rc = *zRealType;
      break;
    case 'w':
    case 'W':







>
>
>
>
>
>
>
>
>
>







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
      rc = *zRealType;
      break;
    case 'g':
    case 'G':
      zRealType = "g";
      rc = *zRealType;
      break;
    case 'm':
    case 'M':
      zRealType = "m";
      rc = *zRealType;
      break;
    case 'n':
    case 'N':
      zRealType = "n";
      rc = *zRealType;
      break;
    case 't':
    case 'T':
      zRealType = "t";
      rc = *zRealType;
      break;
    case 'w':
    case 'W':
101
102
103
104
105
106
107
108




109
110
111
112
113

114

115
116



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131




132
133
134
135
136
137
138
  if( P("from")!=0 && P("to")!=0 ){
    zTimeSpan = mprintf(
          " (event.mtime BETWEEN julianday(%Q) AND julianday(%Q))",
          P("from"), P("to"));
  }else{
    zTimeSpan = " 1";
  }
  if(zRealType){




    statsReportTimelineYFlag = zRealType;
    db_multi_exec("CREATE TEMP VIEW v_reports AS "
                  "SELECT * FROM event WHERE (type GLOB %Q) AND %s",
                  zRealType, zTimeSpan/*safe-for-%s*/);
  }else{

    statsReportTimelineYFlag = "a";

    db_multi_exec("CREATE TEMP VIEW v_reports AS "
                  "SELECT * FROM event WHERE %s", zTimeSpan/*safe-for-%s*/);



  }
  return statsReportType = rc;
}

/*
** Returns a string suitable (for a given value of suitable) for
** use in a label with the header of the /reports pages, dependent
** on the 'type' flag. See stats_report_init_view().
** The returned bytes are static.
*/
static const char *stats_report_label_for_type(){
  assert( statsReportType && "Must call stats_report_init_view() first." );
  switch( statsReportType ){
    case 'c':
      return "check-ins";




    case 'e':
      return "technotes";
    case 'f':
      return "forum posts";
    case 'w':
      return "wiki changes";
    case 't':







|
>
>
>
>





>
|
>
|
|
>
>
>















>
>
>
>







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
  if( P("from")!=0 && P("to")!=0 ){
    zTimeSpan = mprintf(
          " (event.mtime BETWEEN julianday(%Q) AND julianday(%Q))",
          P("from"), P("to"));
  }else{
    zTimeSpan = " 1";
  }
  if( zRealType==0 ){
    statsReportTimelineYFlag = "a";
    db_multi_exec("CREATE TEMP VIEW v_reports AS "
                  "SELECT * FROM event WHERE %s", zTimeSpan/*safe-for-%s*/);
  }else if( rc!='n' && rc!='m' ){
    statsReportTimelineYFlag = zRealType;
    db_multi_exec("CREATE TEMP VIEW v_reports AS "
                  "SELECT * FROM event WHERE (type GLOB %Q) AND %s",
                  zRealType, zTimeSpan/*safe-for-%s*/);
  }else{
    const char *zNot = rc=='n' ? "NOT" : "";
    statsReportTimelineYFlag = "ci";
    db_multi_exec(
      "CREATE TEMP VIEW v_reports AS "
      "SELECT * FROM event WHERE type='ci' AND %s"
      " AND objid %s IN (SELECT cid FROM plink WHERE NOT isprim)",
      zTimeSpan/*safe-for-%s*/, zNot/*safe-for-%s*/
    );        
  }
  return statsReportType = rc;
}

/*
** Returns a string suitable (for a given value of suitable) for
** use in a label with the header of the /reports pages, dependent
** on the 'type' flag. See stats_report_init_view().
** The returned bytes are static.
*/
static const char *stats_report_label_for_type(){
  assert( statsReportType && "Must call stats_report_init_view() first." );
  switch( statsReportType ){
    case 'c':
      return "check-ins";
    case 'm':
      return "merge check-ins";
    case 'n':
      return "non-merge check-ins";
    case 'e':
      return "technotes";
    case 'f':
      return "forum posts";
    case 'w':
      return "wiki changes";
    case 't':
823
824
825
826
827
828
829

830






831
832
833
834
835
836
837
**                        * byweekday
**                        * byhour
**                        * byuser
**                        * byfile
**                        * lastchng
**   user=NAME         Restricts statistics to the given user
**   type=TYPE         Restricts the report to a specific event type:

**                     ci (check-in), f (forum), w (wiki), t (ticket), g (tag)






**                     Defaulting to all event types.
**
** The view-specific query parameters include:
**
** view=byweek:
**
**   y=YYYY            The year to report (default is the server's







>
|
>
>
>
>
>
>







846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
**                        * byweekday
**                        * byhour
**                        * byuser
**                        * byfile
**                        * lastchng
**   user=NAME         Restricts statistics to the given user
**   type=TYPE         Restricts the report to a specific event type:
**                        * all (everything),
**                        * ci  (check-in)
**                        * m   (merge check-in),
**                        * n   (non-merge check-in)
**                        * f   (forum post)
**                        * w   (wiki page change)
**                        * t   (ticket change)
**                        * g   (tag added or removed)
**                     Defaulting to all event types.
**
** The view-specific query parameters include:
**
** view=byweek:
**
**   y=YYYY            The year to report (default is the server's
857
858
859
860
861
862
863


864
865
866
867
868
869
870
     {  "By Year",     "byyear",    RPT_BYYEAR    },
     {  "By Hour",     "byhour",    RPT_BYHOUR    },
  };
  static const char *const azType[] = {
     "a",  "All Changes",
     "ci", "Check-ins",
     "f",  "Forum Posts",


     "g",  "Tags",
     "e",  "Tech Notes",
     "t",  "Tickets",
     "w",  "Wiki"
  };

  login_check_credentials();







>
>







887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
     {  "By Year",     "byyear",    RPT_BYYEAR    },
     {  "By Hour",     "byhour",    RPT_BYHOUR    },
  };
  static const char *const azType[] = {
     "a",  "All Changes",
     "ci", "Check-ins",
     "f",  "Forum Posts",
     "m",  "Merge check-ins",
     "n",  "Non-merge check-ins",
     "g",  "Tags",
     "e",  "Tech Notes",
     "t",  "Tickets",
     "w",  "Wiki"
  };

  login_check_credentials();

Changes to www/changes.wiki.

31
32
33
34
35
36
37


38
39
40


41
42
43
44
45
46
47
     changed to "hz".
  *  The [/help?cmd=status|fossil status] command now detects when a
     file used to be a symlink and has been replaced by a regular file.
     (It previously checked for the inverse case only.)
  *  The [/help?cmd=empty-dirs|empty-dirs setting] now reuses the same
     parser as the *-glob settings instead of its prior idiosyncratic
     parser, allowing quoted whitespace in patterns.


  *  The by-week, by-month, and by-year options of the
     [/help?cmd=/reports|/reports webpage] now show an estimated ultimate
     size of the current week, month, or year as a dashed box.



<h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2>
  *  Users can request a password reset.  This feature is disabledby default.  Use
     the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it.
     New web pages [/help?cmd=/resetpw|/resetpw] and
     [/help?cmd=/reqpwreset|/reqpwreset] added.
  *  Add the [/help?cmd=repack|fossil repack] command (together with







>
>
|
<
|
>
>







31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48
49
50
     changed to "hz".
  *  The [/help?cmd=status|fossil status] command now detects when a
     file used to be a symlink and has been replaced by a regular file.
     (It previously checked for the inverse case only.)
  *  The [/help?cmd=empty-dirs|empty-dirs setting] now reuses the same
     parser as the *-glob settings instead of its prior idiosyncratic
     parser, allowing quoted whitespace in patterns.
  *  Enhancements to the [/help?cmd=/reports|/reports webpage]:
     <ol type="a">
     <li> The by-week, by-month, and by-year options now show an estimated

          size of the current week, month, or year as a dashed box.
     <li> New sub-categories "Merge Check-ins" and "Non-Merge Check-ins".
     </ol>

<h2 id='v2_21'>Changes for version 2.21 (2023-02-25)</h2>
  *  Users can request a password reset.  This feature is disabledby default.  Use
     the new [/help?cmd=self-pw-reset|self-pw-reset property] to enable it.
     New web pages [/help?cmd=/resetpw|/resetpw] and
     [/help?cmd=/reqpwreset|/reqpwreset] added.
  *  Add the [/help?cmd=repack|fossil repack] command (together with