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.
Commit
69d22d3bb192aeee94d38bd09b94dc8ae59ba8fe3528d0c6ccc10c38e9729d89
Parent
4f134e06ce210d4…
1 file changed
+5
-4
+5
-4
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -130,18 +130,19 @@ | ||
| 130 | 130 | "SELECT count(*), sum(sz), sum(length(content))" |
| 131 | 131 | " FROM unversioned" |
| 132 | 132 | " WHERE length(hash)>1" |
| 133 | 133 | ); |
| 134 | 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); | |
| 135 | + sqlite3_int64 iSz, iStored, pct; | |
| 136 | + /* iSz = db_column_int64(&q,1); */ | |
| 137 | 137 | 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); */ | |
| 139 | 140 | approxSizeName(sizeof(zStored), zStored, iStored); |
| 140 | 141 | @ <tr><th>Unversioned Files:</th><td> |
| 141 | 142 | @ %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 | |
| 143 | 144 | @ </td></tr> |
| 144 | 145 | } |
| 145 | 146 | db_finalize(&q); |
| 146 | 147 | } |
| 147 | 148 | @ <tr><th>Number Of Check-ins:</th><td> |
| 148 | 149 |
| --- 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 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 Of 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 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 Of Check-ins:</th><td> |
| 149 |