Fossil SCM
Fix the computation of the percentage of the repo taken up by unversioned files on the /stat page.
Commit
c8b46764b6a913f812b8bac53e5993f23c5877c96d0bddfb7911795c658306d4
Parent
0c57ba3eb47e2a7…
1 file changed
+3
-3
+3
-3
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -113,15 +113,15 @@ | ||
| 113 | 113 | @ %d(szAvg) bytes average, %d(szMax) bytes max, %s(zBuf) total |
| 114 | 114 | @ </td></tr> |
| 115 | 115 | @ <tr><th>Compression Ratio:</th><td> |
| 116 | 116 | if( t/fsize < 5 ){ |
| 117 | 117 | b = 10; |
| 118 | - fsize /= 10; | |
| 118 | + a = t/(fsize/10); | |
| 119 | 119 | }else{ |
| 120 | 120 | b = 1; |
| 121 | + a = t/fsize; | |
| 121 | 122 | } |
| 122 | - a = t/fsize; | |
| 123 | 123 | @ %d(a):%d(b) |
| 124 | 124 | @ </td></tr> |
| 125 | 125 | } |
| 126 | 126 | if( db_table_exists("repository","unversioned") ){ |
| 127 | 127 | Stmt q; |
| @@ -132,11 +132,11 @@ | ||
| 132 | 132 | " WHERE length(hash)>1" |
| 133 | 133 | ); |
| 134 | 134 | if( db_step(&q)==SQLITE_ROW && (n = db_column_int(&q,0))>0 ){ |
| 135 | 135 | sqlite3_int64 iStored, pct; |
| 136 | 136 | iStored = db_column_int64(&q,2); |
| 137 | - pct = (iStored*100 + fsize - 1)/fsize; | |
| 137 | + pct = (iStored*100 + fsize/2)/fsize; | |
| 138 | 138 | approxSizeName(sizeof(zStored), zStored, iStored); |
| 139 | 139 | @ <tr><th>Unversioned Files:</th><td> |
| 140 | 140 | @ %z(href("%R/uvlist"))%d(n) files</a>, |
| 141 | 141 | @ %s(zStored) compressed, %d(pct)%% of total repository space |
| 142 | 142 | @ </td></tr> |
| 143 | 143 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -113,15 +113,15 @@ | |
| 113 | @ %d(szAvg) bytes average, %d(szMax) bytes max, %s(zBuf) total |
| 114 | @ </td></tr> |
| 115 | @ <tr><th>Compression Ratio:</th><td> |
| 116 | if( t/fsize < 5 ){ |
| 117 | b = 10; |
| 118 | fsize /= 10; |
| 119 | }else{ |
| 120 | b = 1; |
| 121 | } |
| 122 | a = t/fsize; |
| 123 | @ %d(a):%d(b) |
| 124 | @ </td></tr> |
| 125 | } |
| 126 | if( db_table_exists("repository","unversioned") ){ |
| 127 | Stmt q; |
| @@ -132,11 +132,11 @@ | |
| 132 | " WHERE length(hash)>1" |
| 133 | ); |
| 134 | if( db_step(&q)==SQLITE_ROW && (n = db_column_int(&q,0))>0 ){ |
| 135 | sqlite3_int64 iStored, pct; |
| 136 | iStored = db_column_int64(&q,2); |
| 137 | pct = (iStored*100 + fsize - 1)/fsize; |
| 138 | approxSizeName(sizeof(zStored), zStored, iStored); |
| 139 | @ <tr><th>Unversioned Files:</th><td> |
| 140 | @ %z(href("%R/uvlist"))%d(n) files</a>, |
| 141 | @ %s(zStored) compressed, %d(pct)%% of total repository space |
| 142 | @ </td></tr> |
| 143 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -113,15 +113,15 @@ | |
| 113 | @ %d(szAvg) bytes average, %d(szMax) bytes max, %s(zBuf) total |
| 114 | @ </td></tr> |
| 115 | @ <tr><th>Compression Ratio:</th><td> |
| 116 | if( t/fsize < 5 ){ |
| 117 | b = 10; |
| 118 | a = t/(fsize/10); |
| 119 | }else{ |
| 120 | b = 1; |
| 121 | a = t/fsize; |
| 122 | } |
| 123 | @ %d(a):%d(b) |
| 124 | @ </td></tr> |
| 125 | } |
| 126 | if( db_table_exists("repository","unversioned") ){ |
| 127 | Stmt q; |
| @@ -132,11 +132,11 @@ | |
| 132 | " WHERE length(hash)>1" |
| 133 | ); |
| 134 | if( db_step(&q)==SQLITE_ROW && (n = db_column_int(&q,0))>0 ){ |
| 135 | sqlite3_int64 iStored, pct; |
| 136 | iStored = db_column_int64(&q,2); |
| 137 | pct = (iStored*100 + fsize/2)/fsize; |
| 138 | approxSizeName(sizeof(zStored), zStored, iStored); |
| 139 | @ <tr><th>Unversioned Files:</th><td> |
| 140 | @ %z(href("%R/uvlist"))%d(n) files</a>, |
| 141 | @ %s(zStored) compressed, %d(pct)%% of total repository space |
| 142 | @ </td></tr> |
| 143 |