Fossil SCM

Merged trunk changes in

wyoung 2020-08-19 21:24 UTC js-policy-doc merge
Commit 32ef4cfa2429b9f378cd0c25c51fb61ad2b0d823c63729a5427f38267d89436e
+1 -1
--- src/diff.c
+++ src/diff.c
@@ -1566,11 +1566,11 @@
15661566
iSYp = iSY;
15671567
iEXp = iEX;
15681568
iEYp = iEY;
15691569
}
15701570
}
1571
- if( iSXb==iEXb && (iE1-iS1)*(iE2-iS2)<400 ){
1571
+ if( iSXb==iEXb && (sqlite3_int64)(iE1-iS1)*(iE2-iS2)<400 ){
15721572
/* If no common sequence is found using the hashing heuristic and
15731573
** the input is not too big, use the expensive exact solution */
15741574
optimalLCS(p, iS1, iE1, iS2, iE2, piSX, piEX, piSY, piEY);
15751575
}else{
15761576
*piSX = iSXb;
15771577
--- src/diff.c
+++ src/diff.c
@@ -1566,11 +1566,11 @@
1566 iSYp = iSY;
1567 iEXp = iEX;
1568 iEYp = iEY;
1569 }
1570 }
1571 if( iSXb==iEXb && (iE1-iS1)*(iE2-iS2)<400 ){
1572 /* If no common sequence is found using the hashing heuristic and
1573 ** the input is not too big, use the expensive exact solution */
1574 optimalLCS(p, iS1, iE1, iS2, iE2, piSX, piEX, piSY, piEY);
1575 }else{
1576 *piSX = iSXb;
1577
--- src/diff.c
+++ src/diff.c
@@ -1566,11 +1566,11 @@
1566 iSYp = iSY;
1567 iEXp = iEX;
1568 iEYp = iEY;
1569 }
1570 }
1571 if( iSXb==iEXb && (sqlite3_int64)(iE1-iS1)*(iE2-iS2)<400 ){
1572 /* If no common sequence is found using the hashing heuristic and
1573 ** the input is not too big, use the expensive exact solution */
1574 optimalLCS(p, iS1, iE1, iS2, iE2, piSX, piEX, piSY, piEY);
1575 }else{
1576 *piSX = iSXb;
1577
+1 -1
--- src/markdown.c
+++ src/markdown.c
@@ -1919,11 +1919,11 @@
19191919
19201920
/* fallback on default alignment if not explicit */
19211921
if( align==0 && aligns && col<align_size ) align = aligns[col];
19221922
19231923
/* render cells */
1924
- if( cells && end>beg ){
1924
+ if( cells && end>=beg ){
19251925
parse_table_cell(cells, rndr, data+beg, end-beg, align|flags);
19261926
}
19271927
19281928
col++;
19291929
}
19301930
--- src/markdown.c
+++ src/markdown.c
@@ -1919,11 +1919,11 @@
1919
1920 /* fallback on default alignment if not explicit */
1921 if( align==0 && aligns && col<align_size ) align = aligns[col];
1922
1923 /* render cells */
1924 if( cells && end>beg ){
1925 parse_table_cell(cells, rndr, data+beg, end-beg, align|flags);
1926 }
1927
1928 col++;
1929 }
1930
--- src/markdown.c
+++ src/markdown.c
@@ -1919,11 +1919,11 @@
1919
1920 /* fallback on default alignment if not explicit */
1921 if( align==0 && aligns && col<align_size ) align = aligns[col];
1922
1923 /* render cells */
1924 if( cells && end>=beg ){
1925 parse_table_cell(cells, rndr, data+beg, end-beg, align|flags);
1926 }
1927
1928 col++;
1929 }
1930
+2 -2
--- src/stat.c
+++ src/stat.c
@@ -153,11 +153,11 @@
153153
fsize = file_size(g.zRepositoryName, ExtFILE);
154154
@ <tr><th>Repository&nbsp;Size:</th><td>%,lld(fsize) bytes</td>
155155
@ </td></tr>
156156
if( !brief ){
157157
@ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
158
- n = db_int(0, "SELECT count(*) FROM blob");
158
+ n = db_int(0, "SELECT count(*) FROM blob WHERE content IS NOT NULL");
159159
m = db_int(0, "SELECT count(*) FROM delta");
160160
@ %.d(n) (%,d(n-m) fulltext and %,d(m) deltas)
161161
if( g.perm.Write ){
162162
@ <a href='%R/artifact_stats'>Details</a>
163163
}
@@ -165,11 +165,11 @@
165165
if( n>0 ){
166166
int a, b;
167167
Stmt q;
168168
@ <tr><th>Uncompressed&nbsp;Artifact&nbsp;Size:</th><td>
169169
db_prepare(&q, "SELECT total(size), avg(size), max(size)"
170
- " FROM blob WHERE size>0 /*scan*/");
170
+ " FROM blob WHERE content IS NOT NULL /*scan*/");
171171
db_step(&q);
172172
t = db_column_int64(&q, 0);
173173
szAvg = db_column_int(&q, 1);
174174
szMax = db_column_int(&q, 2);
175175
db_finalize(&q);
176176
--- src/stat.c
+++ src/stat.c
@@ -153,11 +153,11 @@
153 fsize = file_size(g.zRepositoryName, ExtFILE);
154 @ <tr><th>Repository&nbsp;Size:</th><td>%,lld(fsize) bytes</td>
155 @ </td></tr>
156 if( !brief ){
157 @ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
158 n = db_int(0, "SELECT count(*) FROM blob");
159 m = db_int(0, "SELECT count(*) FROM delta");
160 @ %.d(n) (%,d(n-m) fulltext and %,d(m) deltas)
161 if( g.perm.Write ){
162 @ <a href='%R/artifact_stats'>Details</a>
163 }
@@ -165,11 +165,11 @@
165 if( n>0 ){
166 int a, b;
167 Stmt q;
168 @ <tr><th>Uncompressed&nbsp;Artifact&nbsp;Size:</th><td>
169 db_prepare(&q, "SELECT total(size), avg(size), max(size)"
170 " FROM blob WHERE size>0 /*scan*/");
171 db_step(&q);
172 t = db_column_int64(&q, 0);
173 szAvg = db_column_int(&q, 1);
174 szMax = db_column_int(&q, 2);
175 db_finalize(&q);
176
--- src/stat.c
+++ src/stat.c
@@ -153,11 +153,11 @@
153 fsize = file_size(g.zRepositoryName, ExtFILE);
154 @ <tr><th>Repository&nbsp;Size:</th><td>%,lld(fsize) bytes</td>
155 @ </td></tr>
156 if( !brief ){
157 @ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
158 n = db_int(0, "SELECT count(*) FROM blob WHERE content IS NOT NULL");
159 m = db_int(0, "SELECT count(*) FROM delta");
160 @ %.d(n) (%,d(n-m) fulltext and %,d(m) deltas)
161 if( g.perm.Write ){
162 @ <a href='%R/artifact_stats'>Details</a>
163 }
@@ -165,11 +165,11 @@
165 if( n>0 ){
166 int a, b;
167 Stmt q;
168 @ <tr><th>Uncompressed&nbsp;Artifact&nbsp;Size:</th><td>
169 db_prepare(&q, "SELECT total(size), avg(size), max(size)"
170 " FROM blob WHERE content IS NOT NULL /*scan*/");
171 db_step(&q);
172 t = db_column_int64(&q, 0);
173 szAvg = db_column_int(&q, 1);
174 szMax = db_column_int(&q, 2);
175 db_finalize(&q);
176
+118 -20
--- www/javascript.md
+++ www/javascript.md
@@ -148,37 +148,135 @@
148148
diff them” feature.
149149
150150
[wt]: https://fossil-scm.org/fossil/timeline
151151
152152
153
-### <a id="wedit"></a>WYSIWYG Wiki Editor
154
-
155
-The Admin → Wiki → “Enable WYSIWYG Wiki Editing” toggle switches the
156
-default plaintext editor for [Fossil wiki][fw] documents to one that
157
-works like a basic word processor. This feature requires JavaScript in
158
-order to react to editor button clicks like the “**B**” button, meaning
159
-“make \[selected\] text boldface.” There is no standard WYSIWYG editor
160
-component in browsers, doubtless because it’s relatively straightforward
161
-to create one using JavaScript.
162
-
163
-_Graceful Fallback:_ Edit your wiki documents in the default plain text
164
-wiki editor. Fossil’s wiki and Markdown language processors were
165
-designed to be edited that way.
166
-
167
-[fw]: ./wikitheory.wiki
153
+### <a id="wedit"></a>The New Wiki Editor
154
+
155
+As of Fossil 2.12, the [Fossil wiki][fwt] document editor requires
156
+JavaScript, for a few unavoidable reasons.
157
+
158
+First, it allows in-browser previews without losing client-side editor
159
+state, such as where your cursor is. With the old editor, you had to
160
+re-locate the place you were last editing on each preview, which would
161
+reduce the incentive to use the preview function. In the new wiki
162
+editor, you just click the Preview tab to see how Fossil interprets your
163
+markup, then click back to the Editor tab to resume work with the prior
164
+context undisturbed.
165
+
166
+Second, it continually saves your document state in client-side storage
167
+in the background while you’re editing it so that if the browser closes
168
+without saving the changes back to the Fossil repository, you can resume
169
+editing from the stored copy without losing work. This feature is not so
170
+much about saving you from crashes of various sorts, since computers are
171
+so much more reliable these days. It is far more likely to save you from
172
+the features of mobile OSes like Android and iOS which aggressively shut
173
+down and restart apps to save on RAM. That OS design philosophy assumes
174
+that there is a way for the app to restore its prior state from
175
+persistent media when it’s restarted, giving the illusion that it was
176
+never shut down in the first place. This feature of Fossil’s new wiki
177
+editor provides that.
178
+
179
+There are many other new features in the enhanced Fossil 2.12 wiki
180
+editor, but those are the ones that absolutely require JavaScript to
181
+work.
182
+
183
+With this change, we lost the old WYSIWYG wiki editor, available since
184
+Fossil version 1.24. It hadn’t been maintained for years, it was
185
+disabled by default, and no one stepped up to defend its existence when
186
+this new editor was created, replacing it. If someone rescues that
187
+feature, merging it in with the new editor, it will doubtless require
188
+JavaScript in order to react to editor button clicks like the “**B**”
189
+button, meaning “make \[selected\] text boldface.” There is no standard
190
+WYSIWYG editor component in browsers, doubtless because it’s relatively
191
+straightforward to create one using JavaScript.
192
+
193
+_Graceful Fallback:_ Unlike in the Fossil 2.11 and earlier days, there
194
+is no longer a script-free wiki editor mode. This is not from lack of
195
+desire, only because the person who wrote the new wiki editor didn’t
196
+want to maintain three different editors. (New Ajaxy editor, old
197
+script-free HTML form based editor, and old WYSIWYG JS-based editor.) If
198
+someone wants to implement a `<noscript>` alternative to the new wiki
199
+editor, we will likely accept that [contribution][cg] as long as it
200
+doensn’t interfere with the new editor. (The same goes for adding a
201
+WYSIWYG mode to the new Ajaxy wiki editor.)
202
+
203
+_Workaround:_ You don’t have to use the browser-based wiki editor to
204
+maintain your repository’s wiki at all. Fossil’s [`wiki` command][fwc]
205
+lets you manipulate wiki documents from the command line. For example,
206
+consider this `vi` based workflow:
207
+
208
+```shell
209
+ $ vi 'My Article.wiki' # write, write, write...
210
+ :!fossil create 'My Article' '%' # current file (%) to new article
211
+ ...write, write, write some more...
212
+ :w # save changes to disk copy
213
+ :!fossil commit 'My Article' '%' # update article from disk
214
+ :q # done writing for today
215
+
216
+ ....days later...
217
+ $ vi # work sans named file today
218
+ :r !fossil wiki export 'My Article' - # article text into vi buffer
219
+ ...write, write, write yet more...
220
+ :w !fossil wiki commit - # update article with buffer
221
+```
222
+
223
+Extending this concept to other text editors is an exercise left to the
224
+reader.
225
+
226
+[fwc]: /help?cmd=wiki
227
+[fwt]: ./wikitheory.wiki
228
+
229
+
230
+### <a id="fedit"></a>The File Editor
231
+
232
+Fossil 2.12 adds the [optional file editor feature][fedit], which works
233
+much like [the new wiki editor](#wedit), only on files committed to the
234
+repository.
235
+
236
+The original designed purpose for this feature is to allow [embedded
237
+documentation][edoc] to be interactively edited in the same way that
238
+wiki articles can be. (Indeed, the associated `fileedit-glob` feature
239
+allows you to restrict the editor to working *only* on files that can be
240
+treated as embedded documentation.) This feature operates in much the
241
+same way as the new wiki editor, so most of what we said above applies.
242
+
243
+_Workaround:_ This feature is an alternative to Fossil’s traditional
244
+mode of file management: clone the repository, open it somewhere, edit a
245
+file locally, and commit the changes.
246
+
247
+_Graceful Fallback:_ There is no technical reason why someone could not
248
+write a `<noscript>` wrapped alternative to the current JavaScript based
249
+`/fileedit` implementation. It would have all of the same downsides as
250
+the old wiki editor: the users would lose their place on each save, they
251
+would have no local backup if something crashes, etc. Still, we are
252
+likely to accept such a [contribution][cg] as long as it doesn’t
253
+interfere with the new editor.
254
+
255
+[edoc]: /doc/trunk/www/embeddeddoc.wiki
256
+[fedit]: /help?cmd=/fileedit
168257
169258
170259
### <a id="ln"></a>Line Numbering
171260
172261
When viewing source files, Fossil offers to show line numbers in some
173
-cases. Toggling them on and off is currently handled in JavaScript.
174
-([Example][mainc].)
262
+cases. ([Example][mainc].) Toggling them on and off is currently handled
263
+in JavaScript, rather than forcing a page-reload via a button click.
175264
176265
_Workaround:_ Edit the URL to give the “`ln`” query parameter per [the
177
-`/file` docs](/help?cmd=/file), or provide a patch to reload the page
178
-with this parameter included/excluded to implement the toggle via a
179
-server round-trip.
266
+`/file` docs](/help?cmd=/file). Alternately, someone sufficiently
267
+interested could [provide a patch][cg] to add a `<noscript>` wrapped
268
+HTML button that would reload the page with this parameter
269
+included/excluded to implement the toggle via a server round-trip.
270
+
271
+As of Fossil 2.12, there is also a JavaScript-based interactive method
272
+for selecting a range of lines by clicking the line numbers when they’re
273
+visible, then copying the resulting URL to share your selection with
274
+others.
275
+
276
+_Workaround:_ These interactive features absolutely require JavaScript.
277
+The alternative is to manually edit the URL, per above.
180278
181279
[mainc]: https://fossil-scm.org/fossil/artifact?ln&name=87d67e745
182280
183281
184282
### <a id="sxsdiff"></a>Side-by-Side Diff Mode
185283
--- www/javascript.md
+++ www/javascript.md
@@ -148,37 +148,135 @@
148 diff them” feature.
149
150 [wt]: https://fossil-scm.org/fossil/timeline
151
152
153 ### <a id="wedit"></a>WYSIWYG Wiki Editor
154
155 The Admin → Wiki → “Enable WYSIWYG Wiki Editing” toggle switches the
156 default plaintext editor for [Fossil wiki][fw] documents to one that
157 works like a basic word processor. This feature requires JavaScript in
158 order to react to editor button clicks like the “**B**” button, meaning
159 “make \[selected\] text boldface.” There is no standard WYSIWYG editor
160 component in browsers, doubtless because it’s relatively straightforward
161 to create one using JavaScript.
162
163 _Graceful Fallback:_ Edit your wiki documents in the default plain text
164 wiki editor. Fossil’s wiki and Markdown language processors were
165 designed to be edited that way.
166
167 [fw]: ./wikitheory.wiki
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
169
170 ### <a id="ln"></a>Line Numbering
171
172 When viewing source files, Fossil offers to show line numbers in some
173 cases. Toggling them on and off is currently handled in JavaScript.
174 ([Example][mainc].)
175
176 _Workaround:_ Edit the URL to give the “`ln`” query parameter per [the
177 `/file` docs](/help?cmd=/file), or provide a patch to reload the page
178 with this parameter included/excluded to implement the toggle via a
179 server round-trip.
 
 
 
 
 
 
 
 
 
180
181 [mainc]: https://fossil-scm.org/fossil/artifact?ln&name=87d67e745
182
183
184 ### <a id="sxsdiff"></a>Side-by-Side Diff Mode
185
--- www/javascript.md
+++ www/javascript.md
@@ -148,37 +148,135 @@
148 diff them” feature.
149
150 [wt]: https://fossil-scm.org/fossil/timeline
151
152
153 ### <a id="wedit"></a>The New Wiki Editor
154
155 As of Fossil 2.12, the [Fossil wiki][fwt] document editor requires
156 JavaScript, for a few unavoidable reasons.
157
158 First, it allows in-browser previews without losing client-side editor
159 state, such as where your cursor is. With the old editor, you had to
160 re-locate the place you were last editing on each preview, which would
161 reduce the incentive to use the preview function. In the new wiki
162 editor, you just click the Preview tab to see how Fossil interprets your
163 markup, then click back to the Editor tab to resume work with the prior
164 context undisturbed.
165
166 Second, it continually saves your document state in client-side storage
167 in the background while you’re editing it so that if the browser closes
168 without saving the changes back to the Fossil repository, you can resume
169 editing from the stored copy without losing work. This feature is not so
170 much about saving you from crashes of various sorts, since computers are
171 so much more reliable these days. It is far more likely to save you from
172 the features of mobile OSes like Android and iOS which aggressively shut
173 down and restart apps to save on RAM. That OS design philosophy assumes
174 that there is a way for the app to restore its prior state from
175 persistent media when it’s restarted, giving the illusion that it was
176 never shut down in the first place. This feature of Fossil’s new wiki
177 editor provides that.
178
179 There are many other new features in the enhanced Fossil 2.12 wiki
180 editor, but those are the ones that absolutely require JavaScript to
181 work.
182
183 With this change, we lost the old WYSIWYG wiki editor, available since
184 Fossil version 1.24. It hadn’t been maintained for years, it was
185 disabled by default, and no one stepped up to defend its existence when
186 this new editor was created, replacing it. If someone rescues that
187 feature, merging it in with the new editor, it will doubtless require
188 JavaScript in order to react to editor button clicks like the “**B**”
189 button, meaning “make \[selected\] text boldface.” There is no standard
190 WYSIWYG editor component in browsers, doubtless because it’s relatively
191 straightforward to create one using JavaScript.
192
193 _Graceful Fallback:_ Unlike in the Fossil 2.11 and earlier days, there
194 is no longer a script-free wiki editor mode. This is not from lack of
195 desire, only because the person who wrote the new wiki editor didn’t
196 want to maintain three different editors. (New Ajaxy editor, old
197 script-free HTML form based editor, and old WYSIWYG JS-based editor.) If
198 someone wants to implement a `<noscript>` alternative to the new wiki
199 editor, we will likely accept that [contribution][cg] as long as it
200 doensn’t interfere with the new editor. (The same goes for adding a
201 WYSIWYG mode to the new Ajaxy wiki editor.)
202
203 _Workaround:_ You don’t have to use the browser-based wiki editor to
204 maintain your repository’s wiki at all. Fossil’s [`wiki` command][fwc]
205 lets you manipulate wiki documents from the command line. For example,
206 consider this `vi` based workflow:
207
208 ```shell
209 $ vi 'My Article.wiki' # write, write, write...
210 :!fossil create 'My Article' '%' # current file (%) to new article
211 ...write, write, write some more...
212 :w # save changes to disk copy
213 :!fossil commit 'My Article' '%' # update article from disk
214 :q # done writing for today
215
216 ....days later...
217 $ vi # work sans named file today
218 :r !fossil wiki export 'My Article' - # article text into vi buffer
219 ...write, write, write yet more...
220 :w !fossil wiki commit - # update article with buffer
221 ```
222
223 Extending this concept to other text editors is an exercise left to the
224 reader.
225
226 [fwc]: /help?cmd=wiki
227 [fwt]: ./wikitheory.wiki
228
229
230 ### <a id="fedit"></a>The File Editor
231
232 Fossil 2.12 adds the [optional file editor feature][fedit], which works
233 much like [the new wiki editor](#wedit), only on files committed to the
234 repository.
235
236 The original designed purpose for this feature is to allow [embedded
237 documentation][edoc] to be interactively edited in the same way that
238 wiki articles can be. (Indeed, the associated `fileedit-glob` feature
239 allows you to restrict the editor to working *only* on files that can be
240 treated as embedded documentation.) This feature operates in much the
241 same way as the new wiki editor, so most of what we said above applies.
242
243 _Workaround:_ This feature is an alternative to Fossil’s traditional
244 mode of file management: clone the repository, open it somewhere, edit a
245 file locally, and commit the changes.
246
247 _Graceful Fallback:_ There is no technical reason why someone could not
248 write a `<noscript>` wrapped alternative to the current JavaScript based
249 `/fileedit` implementation. It would have all of the same downsides as
250 the old wiki editor: the users would lose their place on each save, they
251 would have no local backup if something crashes, etc. Still, we are
252 likely to accept such a [contribution][cg] as long as it doesn’t
253 interfere with the new editor.
254
255 [edoc]: /doc/trunk/www/embeddeddoc.wiki
256 [fedit]: /help?cmd=/fileedit
257
258
259 ### <a id="ln"></a>Line Numbering
260
261 When viewing source files, Fossil offers to show line numbers in some
262 cases. ([Example][mainc].) Toggling them on and off is currently handled
263 in JavaScript, rather than forcing a page-reload via a button click.
264
265 _Workaround:_ Edit the URL to give the “`ln`” query parameter per [the
266 `/file` docs](/help?cmd=/file). Alternately, someone sufficiently
267 interested could [provide a patch][cg] to add a `<noscript>` wrapped
268 HTML button that would reload the page with this parameter
269 included/excluded to implement the toggle via a server round-trip.
270
271 As of Fossil 2.12, there is also a JavaScript-based interactive method
272 for selecting a range of lines by clicking the line numbers when they’re
273 visible, then copying the resulting URL to share your selection with
274 others.
275
276 _Workaround:_ These interactive features absolutely require JavaScript.
277 The alternative is to manually edit the URL, per above.
278
279 [mainc]: https://fossil-scm.org/fossil/artifact?ln&name=87d67e745
280
281
282 ### <a id="sxsdiff"></a>Side-by-Side Diff Mode
283

Keyboard Shortcuts

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