Fossil SCM

On the /stat page, show only the compressed size of unversioned artifacts, and show the percentage of the total repository space taken up by unversioned files.

drh 2017-09-19 20:00 trunk
Commit 69d22d3bb192aeee94d38bd09b94dc8ae59ba8fe3528d0c6ccc10c38e9729d89
1 file changed +5 -4
+5 -4
--- src/stat.c
+++ src/stat.c
@@ -130,18 +130,19 @@
130130
"SELECT count(*), sum(sz), sum(length(content))"
131131
" FROM unversioned"
132132
" WHERE length(hash)>1"
133133
);
134134
if( db_step(&q)==SQLITE_ROW && (n = db_column_int(&q,0))>0 ){
135
- sqlite3_int64 iSz, iStored;
136
- iSz = db_column_int64(&q,1);
135
+ sqlite3_int64 iSz, iStored, pct;
136
+ /* iSz = db_column_int64(&q,1); */
137137
iStored = db_column_int64(&q,2);
138
- approxSizeName(sizeof(zBuf), zBuf, iSz);
138
+ pct = (iStored*100 + fsize - 1)/fsize;
139
+ /* approxSizeName(sizeof(zBuf), zBuf, iSz); */
139140
approxSizeName(sizeof(zStored), zStored, iStored);
140141
@ <tr><th>Unversioned&nbsp;Files:</th><td>
141142
@ %z(href("%R/uvlist"))%d(n) files</a>,
142
- @ total size %s(zBuf) uncompressed, %s(zStored) compressed
143
+ @ %s(zStored) compressed, %d(pct)%% of total repository space
143144
@ </td></tr>
144145
}
145146
db_finalize(&q);
146147
}
147148
@ <tr><th>Number&nbsp;Of&nbsp;Check-ins:</th><td>
148149
--- src/stat.c
+++ src/stat.c
@@ -130,18 +130,19 @@
130 "SELECT count(*), sum(sz), sum(length(content))"
131 " FROM unversioned"
132 " WHERE length(hash)>1"
133 );
134 if( db_step(&q)==SQLITE_ROW && (n = db_column_int(&q,0))>0 ){
135 sqlite3_int64 iSz, iStored;
136 iSz = db_column_int64(&q,1);
137 iStored = db_column_int64(&q,2);
138 approxSizeName(sizeof(zBuf), zBuf, iSz);
 
139 approxSizeName(sizeof(zStored), zStored, iStored);
140 @ <tr><th>Unversioned&nbsp;Files:</th><td>
141 @ %z(href("%R/uvlist"))%d(n) files</a>,
142 @ total size %s(zBuf) uncompressed, %s(zStored) compressed
143 @ </td></tr>
144 }
145 db_finalize(&q);
146 }
147 @ <tr><th>Number&nbsp;Of&nbsp;Check-ins:</th><td>
148
--- src/stat.c
+++ src/stat.c
@@ -130,18 +130,19 @@
130 "SELECT count(*), sum(sz), sum(length(content))"
131 " FROM unversioned"
132 " WHERE length(hash)>1"
133 );
134 if( db_step(&q)==SQLITE_ROW && (n = db_column_int(&q,0))>0 ){
135 sqlite3_int64 iSz, iStored, pct;
136 /* iSz = db_column_int64(&q,1); */
137 iStored = db_column_int64(&q,2);
138 pct = (iStored*100 + fsize - 1)/fsize;
139 /* approxSizeName(sizeof(zBuf), zBuf, iSz); */
140 approxSizeName(sizeof(zStored), zStored, iStored);
141 @ <tr><th>Unversioned&nbsp;Files:</th><td>
142 @ %z(href("%R/uvlist"))%d(n) files</a>,
143 @ %s(zStored) compressed, %d(pct)%% of total repository space
144 @ </td></tr>
145 }
146 db_finalize(&q);
147 }
148 @ <tr><th>Number&nbsp;Of&nbsp;Check-ins:</th><td>
149

Keyboard Shortcuts

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