Fossil SCM

Fix the computation of the percentage of the repo taken up by unversioned files on the /stat page.

drh 2017-10-02 02:30 trunk
Commit c8b46764b6a913f812b8bac53e5993f23c5877c96d0bddfb7911795c658306d4
1 file changed +3 -3
+3 -3
--- src/stat.c
+++ src/stat.c
@@ -113,15 +113,15 @@
113113
@ %d(szAvg) bytes average, %d(szMax) bytes max, %s(zBuf) total
114114
@ </td></tr>
115115
@ <tr><th>Compression&nbsp;Ratio:</th><td>
116116
if( t/fsize < 5 ){
117117
b = 10;
118
- fsize /= 10;
118
+ a = t/(fsize/10);
119119
}else{
120120
b = 1;
121
+ a = t/fsize;
121122
}
122
- a = t/fsize;
123123
@ %d(a):%d(b)
124124
@ </td></tr>
125125
}
126126
if( db_table_exists("repository","unversioned") ){
127127
Stmt q;
@@ -132,11 +132,11 @@
132132
" WHERE length(hash)>1"
133133
);
134134
if( db_step(&q)==SQLITE_ROW && (n = db_column_int(&q,0))>0 ){
135135
sqlite3_int64 iStored, pct;
136136
iStored = db_column_int64(&q,2);
137
- pct = (iStored*100 + fsize - 1)/fsize;
137
+ pct = (iStored*100 + fsize/2)/fsize;
138138
approxSizeName(sizeof(zStored), zStored, iStored);
139139
@ <tr><th>Unversioned&nbsp;Files:</th><td>
140140
@ %z(href("%R/uvlist"))%d(n) files</a>,
141141
@ %s(zStored) compressed, %d(pct)%% of total repository space
142142
@ </td></tr>
143143
--- 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&nbsp;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&nbsp;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&nbsp;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&nbsp;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

Keyboard Shortcuts

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