Fossil SCM

Add the --dark option to "fossil diff --tk"

drh 2023-12-07 20:06 trunk merge
Commit 5a8516df59a6ce05fbbc35c2e9bd9463501c1fa2283c14786fb20b17b8bb5081
+2
--- src/diff.c
+++ src/diff.c
@@ -48,10 +48,11 @@
4848
#define DIFF_DEBUG 0x00020000 /* Debugging diff output */
4949
#define DIFF_RAW 0x00040000 /* Raw triples - for debugging */
5050
#define DIFF_TCL 0x00080000 /* For the --tk option */
5151
#define DIFF_INCBINARY 0x00100000 /* The --diff-binary option */
5252
#define DIFF_SHOW_VERS 0x00200000 /* Show compared versions */
53
+#define DIFF_DARKMODE 0x00400000 /* Use dark mode for HTML */
5354
5455
/*
5556
** These error messages are shared in multiple locations. They are defined
5657
** here for consistency.
5758
*/
@@ -3160,10 +3161,11 @@
31603161
}
31613162
if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO;
31623163
if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT;
31633164
if( find_option("numstat",0,0)!=0 ) diffFlags |= DIFF_NUMSTAT;
31643165
if( find_option("versions","h",0)!=0 ) diffFlags |= DIFF_SHOW_VERS;
3166
+ if( find_option("dark",0,0)!=0 ) diffFlags |= DIFF_DARKMODE;
31653167
if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT;
31663168
if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF;
31673169
if( find_option("internal","i",0)==0
31683170
&& (diffFlags & (DIFF_HTML|DIFF_TCL|DIFF_DEBUG|DIFF_JSON))==0
31693171
){
31703172
--- src/diff.c
+++ src/diff.c
@@ -48,10 +48,11 @@
48 #define DIFF_DEBUG 0x00020000 /* Debugging diff output */
49 #define DIFF_RAW 0x00040000 /* Raw triples - for debugging */
50 #define DIFF_TCL 0x00080000 /* For the --tk option */
51 #define DIFF_INCBINARY 0x00100000 /* The --diff-binary option */
52 #define DIFF_SHOW_VERS 0x00200000 /* Show compared versions */
 
53
54 /*
55 ** These error messages are shared in multiple locations. They are defined
56 ** here for consistency.
57 */
@@ -3160,10 +3161,11 @@
3160 }
3161 if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO;
3162 if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT;
3163 if( find_option("numstat",0,0)!=0 ) diffFlags |= DIFF_NUMSTAT;
3164 if( find_option("versions","h",0)!=0 ) diffFlags |= DIFF_SHOW_VERS;
 
3165 if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT;
3166 if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF;
3167 if( find_option("internal","i",0)==0
3168 && (diffFlags & (DIFF_HTML|DIFF_TCL|DIFF_DEBUG|DIFF_JSON))==0
3169 ){
3170
--- src/diff.c
+++ src/diff.c
@@ -48,10 +48,11 @@
48 #define DIFF_DEBUG 0x00020000 /* Debugging diff output */
49 #define DIFF_RAW 0x00040000 /* Raw triples - for debugging */
50 #define DIFF_TCL 0x00080000 /* For the --tk option */
51 #define DIFF_INCBINARY 0x00100000 /* The --diff-binary option */
52 #define DIFF_SHOW_VERS 0x00200000 /* Show compared versions */
53 #define DIFF_DARKMODE 0x00400000 /* Use dark mode for HTML */
54
55 /*
56 ** These error messages are shared in multiple locations. They are defined
57 ** here for consistency.
58 */
@@ -3160,10 +3161,11 @@
3161 }
3162 if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO;
3163 if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT;
3164 if( find_option("numstat",0,0)!=0 ) diffFlags |= DIFF_NUMSTAT;
3165 if( find_option("versions","h",0)!=0 ) diffFlags |= DIFF_SHOW_VERS;
3166 if( find_option("dark",0,0)!=0 ) diffFlags |= DIFF_DARKMODE;
3167 if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT;
3168 if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF;
3169 if( find_option("internal","i",0)==0
3170 && (diffFlags & (DIFF_HTML|DIFF_TCL|DIFF_DEBUG|DIFF_JSON))==0
3171 ){
3172
+2
--- src/diff.c
+++ src/diff.c
@@ -48,10 +48,11 @@
4848
#define DIFF_DEBUG 0x00020000 /* Debugging diff output */
4949
#define DIFF_RAW 0x00040000 /* Raw triples - for debugging */
5050
#define DIFF_TCL 0x00080000 /* For the --tk option */
5151
#define DIFF_INCBINARY 0x00100000 /* The --diff-binary option */
5252
#define DIFF_SHOW_VERS 0x00200000 /* Show compared versions */
53
+#define DIFF_DARKMODE 0x00400000 /* Use dark mode for HTML */
5354
5455
/*
5556
** These error messages are shared in multiple locations. They are defined
5657
** here for consistency.
5758
*/
@@ -3160,10 +3161,11 @@
31603161
}
31613162
if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO;
31623163
if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT;
31633164
if( find_option("numstat",0,0)!=0 ) diffFlags |= DIFF_NUMSTAT;
31643165
if( find_option("versions","h",0)!=0 ) diffFlags |= DIFF_SHOW_VERS;
3166
+ if( find_option("dark",0,0)!=0 ) diffFlags |= DIFF_DARKMODE;
31653167
if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT;
31663168
if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF;
31673169
if( find_option("internal","i",0)==0
31683170
&& (diffFlags & (DIFF_HTML|DIFF_TCL|DIFF_DEBUG|DIFF_JSON))==0
31693171
){
31703172
--- src/diff.c
+++ src/diff.c
@@ -48,10 +48,11 @@
48 #define DIFF_DEBUG 0x00020000 /* Debugging diff output */
49 #define DIFF_RAW 0x00040000 /* Raw triples - for debugging */
50 #define DIFF_TCL 0x00080000 /* For the --tk option */
51 #define DIFF_INCBINARY 0x00100000 /* The --diff-binary option */
52 #define DIFF_SHOW_VERS 0x00200000 /* Show compared versions */
 
53
54 /*
55 ** These error messages are shared in multiple locations. They are defined
56 ** here for consistency.
57 */
@@ -3160,10 +3161,11 @@
3160 }
3161 if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO;
3162 if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT;
3163 if( find_option("numstat",0,0)!=0 ) diffFlags |= DIFF_NUMSTAT;
3164 if( find_option("versions","h",0)!=0 ) diffFlags |= DIFF_SHOW_VERS;
 
3165 if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT;
3166 if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF;
3167 if( find_option("internal","i",0)==0
3168 && (diffFlags & (DIFF_HTML|DIFF_TCL|DIFF_DEBUG|DIFF_JSON))==0
3169 ){
3170
--- src/diff.c
+++ src/diff.c
@@ -48,10 +48,11 @@
48 #define DIFF_DEBUG 0x00020000 /* Debugging diff output */
49 #define DIFF_RAW 0x00040000 /* Raw triples - for debugging */
50 #define DIFF_TCL 0x00080000 /* For the --tk option */
51 #define DIFF_INCBINARY 0x00100000 /* The --diff-binary option */
52 #define DIFF_SHOW_VERS 0x00200000 /* Show compared versions */
53 #define DIFF_DARKMODE 0x00400000 /* Use dark mode for HTML */
54
55 /*
56 ** These error messages are shared in multiple locations. They are defined
57 ** here for consistency.
58 */
@@ -3160,10 +3161,11 @@
3161 }
3162 if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO;
3163 if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT;
3164 if( find_option("numstat",0,0)!=0 ) diffFlags |= DIFF_NUMSTAT;
3165 if( find_option("versions","h",0)!=0 ) diffFlags |= DIFF_SHOW_VERS;
3166 if( find_option("dark",0,0)!=0 ) diffFlags |= DIFF_DARKMODE;
3167 if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT;
3168 if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF;
3169 if( find_option("internal","i",0)==0
3170 && (diffFlags & (DIFF_HTML|DIFF_TCL|DIFF_DEBUG|DIFF_JSON))==0
3171 ){
3172
+32 -1
--- src/diff.tcl
+++ src/diff.tcl
@@ -8,11 +8,11 @@
88
# This header comment is stripped off by the "mkbuiltin.c" program.
99
#
1010
set prog {
1111
package require Tk
1212
13
-array set CFG {
13
+array set CFG_light {
1414
TITLE {Fossil Diff}
1515
LN_COL_BG #dddddd
1616
LN_COL_FG #444444
1717
TXT_COL_BG #ffffff
1818
TXT_COL_FG #000000
@@ -32,10 +32,41 @@
3232
WIDTH 80
3333
HEIGHT 45
3434
LB_HEIGHT 25
3535
}
3636
37
+array set CFG_dark {
38
+ TITLE {Fossil Diff}
39
+ LN_COL_BG #dddddd
40
+ LN_COL_FG #444444
41
+ TXT_COL_BG #3f3f3f
42
+ TXT_COL_FG #dcdccc
43
+ MKR_COL_BG #444444
44
+ MKR_COL_FG #dddddd
45
+ CHNG_BG #6a6afc
46
+ ADD_BG #57934c
47
+ RM_BG #ef6767
48
+ HR_FG #444444
49
+ HR_PAD_TOP 4
50
+ HR_PAD_BTM 8
51
+ FN_BG #5e5e5e
52
+ FN_FG #ffffff
53
+ FN_PAD 5
54
+ ERR_FG #ee0000
55
+ PADX 5
56
+ WIDTH 80
57
+ HEIGHT 45
58
+ LB_HEIGHT 25
59
+}
60
+
61
+array set CFG_arr {
62
+ 0 CFG_light
63
+ 1 CFG_dark
64
+}
65
+
66
+array set CFG [array get $CFG_arr($darkmode)]
67
+
3768
if {![namespace exists ttk]} {
3869
interp alias {} ::ttk::scrollbar {} ::scrollbar
3970
interp alias {} ::ttk::menubutton {} ::menubutton
4071
}
4172
4273
--- src/diff.tcl
+++ src/diff.tcl
@@ -8,11 +8,11 @@
8 # This header comment is stripped off by the "mkbuiltin.c" program.
9 #
10 set prog {
11 package require Tk
12
13 array set CFG {
14 TITLE {Fossil Diff}
15 LN_COL_BG #dddddd
16 LN_COL_FG #444444
17 TXT_COL_BG #ffffff
18 TXT_COL_FG #000000
@@ -32,10 +32,41 @@
32 WIDTH 80
33 HEIGHT 45
34 LB_HEIGHT 25
35 }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37 if {![namespace exists ttk]} {
38 interp alias {} ::ttk::scrollbar {} ::scrollbar
39 interp alias {} ::ttk::menubutton {} ::menubutton
40 }
41
42
--- src/diff.tcl
+++ src/diff.tcl
@@ -8,11 +8,11 @@
8 # This header comment is stripped off by the "mkbuiltin.c" program.
9 #
10 set prog {
11 package require Tk
12
13 array set CFG_light {
14 TITLE {Fossil Diff}
15 LN_COL_BG #dddddd
16 LN_COL_FG #444444
17 TXT_COL_BG #ffffff
18 TXT_COL_FG #000000
@@ -32,10 +32,41 @@
32 WIDTH 80
33 HEIGHT 45
34 LB_HEIGHT 25
35 }
36
37 array set CFG_dark {
38 TITLE {Fossil Diff}
39 LN_COL_BG #dddddd
40 LN_COL_FG #444444
41 TXT_COL_BG #3f3f3f
42 TXT_COL_FG #dcdccc
43 MKR_COL_BG #444444
44 MKR_COL_FG #dddddd
45 CHNG_BG #6a6afc
46 ADD_BG #57934c
47 RM_BG #ef6767
48 HR_FG #444444
49 HR_PAD_TOP 4
50 HR_PAD_BTM 8
51 FN_BG #5e5e5e
52 FN_FG #ffffff
53 FN_PAD 5
54 ERR_FG #ee0000
55 PADX 5
56 WIDTH 80
57 HEIGHT 45
58 LB_HEIGHT 25
59 }
60
61 array set CFG_arr {
62 0 CFG_light
63 1 CFG_dark
64 }
65
66 array set CFG [array get $CFG_arr($darkmode)]
67
68 if {![namespace exists ttk]} {
69 interp alias {} ::ttk::scrollbar {} ::scrollbar
70 interp alias {} ::ttk::menubutton {} ::menubutton
71 }
72
73
+113 -3
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -213,11 +213,11 @@
213213
}
214214
}
215215
216216
217217
/*
218
-** Default header text for diff with --webpage
218
+** Default header texts for diff with --webpage
219219
*/
220220
static const char zWebpageHdr[] =
221221
@ <!DOCTYPE html>
222222
@ <html>
223223
@ <head>
@@ -314,10 +314,116 @@
314314
@ }
315315
@
316316
@ </style>
317317
@ </head>
318318
@ <body>
319
+;
320
+static const char zWebpageHdrDark[] =
321
+@ <!DOCTYPE html>
322
+@ <html>
323
+@ <head>
324
+@ <meta charset="UTF-8">
325
+@ <style>
326
+@ body {
327
+@ background-color: #353535;
328
+@ color: #ffffff;
329
+@ }
330
+@ h1 {
331
+@ font-size: 150%;
332
+@ }
333
+@
334
+@ table.diff {
335
+@ width: 100%;
336
+@ border-spacing: 0;
337
+@ border: 1px solid black;
338
+@ line-height: inherit;
339
+@ font-size: inherit;
340
+@ }
341
+@ table.diff td {
342
+@ vertical-align: top;
343
+@ line-height: inherit;
344
+@ font-size: inherit;
345
+@ }
346
+@ table.diff pre {
347
+@ margin: 0 0 0 0;
348
+@ line-height: inherit;
349
+@ font-size: inherit;
350
+@ }
351
+@ td.diffln {
352
+@ width: 1px;
353
+@ text-align: right;
354
+@ padding: 0 1em 0 0;
355
+@ }
356
+@ td.difflne {
357
+@ padding-bottom: 0.4em;
358
+@ }
359
+@ td.diffsep {
360
+@ width: 1px;
361
+@ padding: 0 0.3em 0 1em;
362
+@ line-height: inherit;
363
+@ font-size: inherit;
364
+@ }
365
+@ td.diffsep pre {
366
+@ line-height: inherit;
367
+@ font-size: inherit;
368
+@ }
369
+@ td.difftxt pre {
370
+@ overflow-x: auto;
371
+@ }
372
+@ td.diffln ins {
373
+@ background-color: #559855;
374
+@ color: #000000;
375
+@ text-decoration: none;
376
+@ line-height: inherit;
377
+@ font-size: inherit;
378
+@ }
379
+@ td.diffln del {
380
+@ background-color: #cc5555;
381
+@ color: #000000;
382
+@ text-decoration: none;
383
+@ line-height: inherit;
384
+@ font-size: inherit;
385
+@ }
386
+@ td.difftxt del {
387
+@ background-color: #f9cfcf;
388
+@ color: #000000;
389
+@ text-decoration: none;
390
+@ line-height: inherit;
391
+@ font-size: inherit;
392
+@ }
393
+@ td.difftxt del > del {
394
+@ background-color: #cc5555;
395
+@ color: #000000;
396
+@ text-decoration: none;
397
+@ font-weight: bold;
398
+@ }
399
+@ td.difftxt del > del.edit {
400
+@ background-color: #c0c0ff;
401
+@ text-decoration: none;
402
+@ font-weight: bold;
403
+@ }
404
+@ td.difftxt ins {
405
+@ background-color: #a2dbb2;
406
+@ color: #000000;
407
+@ text-decoration: none;
408
+@ line-height: inherit;
409
+@ font-size: inherit;
410
+@ }
411
+@ td.difftxt ins > ins {
412
+@ background-color: #559855;
413
+@ text-decoration: none;
414
+@ font-weight: bold;
415
+@ }
416
+@ td.difftxt ins > ins.edit {
417
+@ background-color: #c0c0ff;
418
+@ text-decoration: none;
419
+@ font-weight: bold;
420
+@ }
421
+@
422
+@ </style>
423
+@ </head>
424
+@ <body>
319425
;
320426
const char zWebpageEnd[] =
321427
@ </body>
322428
@ </html>
323429
;
@@ -378,11 +484,12 @@
378484
#else
379485
SetConsoleCtrlHandler(diff_console_ctrl_handler, TRUE);
380486
#endif
381487
}
382488
if( (pCfg->diffFlags & DIFF_WEBPAGE)!=0 ){
383
- fossil_print("%s",zWebpageHdr);
489
+ fossil_print("%s",(pCfg->diffFlags & DIFF_DARKMODE)!=0 ? zWebpageHdrDark :
490
+ zWebpageHdr);
384491
fflush(stdout);
385492
}
386493
}
387494
388495
/* Do any final output required by a diff and complete the diff
@@ -956,10 +1063,11 @@
9561063
int i;
9571064
Blob script;
9581065
const char *zTempFile = 0;
9591066
char *zCmd;
9601067
const char *zTclsh;
1068
+ int bDarkMode = find_option("dark",0,0)!=0;
9611069
blob_zero(&script);
9621070
blob_appendf(&script, "set fossilcmd {| \"%/\" %s -tcl -i -v",
9631071
g.nameOfExe, zSubCmd);
9641072
find_option("tcl",0,0);
9651073
find_option("html",0,0);
@@ -982,11 +1090,12 @@
9821090
int j;
9831091
blob_append(&script, " ", 1);
9841092
for(j=0; z[j]; j++) blob_appendf(&script, "\\%03o", (unsigned char)z[j]);
9851093
}
9861094
}
987
- blob_appendf(&script, "}\n%s", builtin_file("diff.tcl", 0));
1095
+ blob_appendf(&script, "}\nset darkmode %d\n", bDarkMode);
1096
+ blob_appendf(&script, "%s", builtin_file("diff.tcl", 0));
9881097
if( zTempFile ){
9891098
blob_write_to_file(&script, zTempFile);
9901099
fossil_print("To see diff, run: %s \"%s\"\n", zTclsh, zTempFile);
9911100
}else{
9921101
#if defined(FOSSIL_ENABLE_TCL)
@@ -1078,10 +1187,11 @@
10781187
** --by Shorthand for "--browser -y"
10791188
** -ci|--checkin VERSION Show diff of all changes in VERSION
10801189
** --command PROG External diff program. Overrides "diff-command"
10811190
** -c|--context N Show N lines of context around each change, with
10821191
** negative N meaning show all content
1192
+** --dark Use dark mode for the TCL/TK-based GUI and HTML
10831193
** --diff-binary BOOL Include binary files with external commands
10841194
** --exec-abs-paths Force absolute path names on external commands
10851195
** --exec-rel-paths Force relative path names on external commands
10861196
** -r|--from VERSION Select VERSION as source for the diff
10871197
** -w|--ignore-all-space Ignore white space when comparing lines
10881198
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -213,11 +213,11 @@
213 }
214 }
215
216
217 /*
218 ** Default header text for diff with --webpage
219 */
220 static const char zWebpageHdr[] =
221 @ <!DOCTYPE html>
222 @ <html>
223 @ <head>
@@ -314,10 +314,116 @@
314 @ }
315 @
316 @ </style>
317 @ </head>
318 @ <body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319 ;
320 const char zWebpageEnd[] =
321 @ </body>
322 @ </html>
323 ;
@@ -378,11 +484,12 @@
378 #else
379 SetConsoleCtrlHandler(diff_console_ctrl_handler, TRUE);
380 #endif
381 }
382 if( (pCfg->diffFlags & DIFF_WEBPAGE)!=0 ){
383 fossil_print("%s",zWebpageHdr);
 
384 fflush(stdout);
385 }
386 }
387
388 /* Do any final output required by a diff and complete the diff
@@ -956,10 +1063,11 @@
956 int i;
957 Blob script;
958 const char *zTempFile = 0;
959 char *zCmd;
960 const char *zTclsh;
 
961 blob_zero(&script);
962 blob_appendf(&script, "set fossilcmd {| \"%/\" %s -tcl -i -v",
963 g.nameOfExe, zSubCmd);
964 find_option("tcl",0,0);
965 find_option("html",0,0);
@@ -982,11 +1090,12 @@
982 int j;
983 blob_append(&script, " ", 1);
984 for(j=0; z[j]; j++) blob_appendf(&script, "\\%03o", (unsigned char)z[j]);
985 }
986 }
987 blob_appendf(&script, "}\n%s", builtin_file("diff.tcl", 0));
 
988 if( zTempFile ){
989 blob_write_to_file(&script, zTempFile);
990 fossil_print("To see diff, run: %s \"%s\"\n", zTclsh, zTempFile);
991 }else{
992 #if defined(FOSSIL_ENABLE_TCL)
@@ -1078,10 +1187,11 @@
1078 ** --by Shorthand for "--browser -y"
1079 ** -ci|--checkin VERSION Show diff of all changes in VERSION
1080 ** --command PROG External diff program. Overrides "diff-command"
1081 ** -c|--context N Show N lines of context around each change, with
1082 ** negative N meaning show all content
 
1083 ** --diff-binary BOOL Include binary files with external commands
1084 ** --exec-abs-paths Force absolute path names on external commands
1085 ** --exec-rel-paths Force relative path names on external commands
1086 ** -r|--from VERSION Select VERSION as source for the diff
1087 ** -w|--ignore-all-space Ignore white space when comparing lines
1088
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -213,11 +213,11 @@
213 }
214 }
215
216
217 /*
218 ** Default header texts for diff with --webpage
219 */
220 static const char zWebpageHdr[] =
221 @ <!DOCTYPE html>
222 @ <html>
223 @ <head>
@@ -314,10 +314,116 @@
314 @ }
315 @
316 @ </style>
317 @ </head>
318 @ <body>
319 ;
320 static const char zWebpageHdrDark[] =
321 @ <!DOCTYPE html>
322 @ <html>
323 @ <head>
324 @ <meta charset="UTF-8">
325 @ <style>
326 @ body {
327 @ background-color: #353535;
328 @ color: #ffffff;
329 @ }
330 @ h1 {
331 @ font-size: 150%;
332 @ }
333 @
334 @ table.diff {
335 @ width: 100%;
336 @ border-spacing: 0;
337 @ border: 1px solid black;
338 @ line-height: inherit;
339 @ font-size: inherit;
340 @ }
341 @ table.diff td {
342 @ vertical-align: top;
343 @ line-height: inherit;
344 @ font-size: inherit;
345 @ }
346 @ table.diff pre {
347 @ margin: 0 0 0 0;
348 @ line-height: inherit;
349 @ font-size: inherit;
350 @ }
351 @ td.diffln {
352 @ width: 1px;
353 @ text-align: right;
354 @ padding: 0 1em 0 0;
355 @ }
356 @ td.difflne {
357 @ padding-bottom: 0.4em;
358 @ }
359 @ td.diffsep {
360 @ width: 1px;
361 @ padding: 0 0.3em 0 1em;
362 @ line-height: inherit;
363 @ font-size: inherit;
364 @ }
365 @ td.diffsep pre {
366 @ line-height: inherit;
367 @ font-size: inherit;
368 @ }
369 @ td.difftxt pre {
370 @ overflow-x: auto;
371 @ }
372 @ td.diffln ins {
373 @ background-color: #559855;
374 @ color: #000000;
375 @ text-decoration: none;
376 @ line-height: inherit;
377 @ font-size: inherit;
378 @ }
379 @ td.diffln del {
380 @ background-color: #cc5555;
381 @ color: #000000;
382 @ text-decoration: none;
383 @ line-height: inherit;
384 @ font-size: inherit;
385 @ }
386 @ td.difftxt del {
387 @ background-color: #f9cfcf;
388 @ color: #000000;
389 @ text-decoration: none;
390 @ line-height: inherit;
391 @ font-size: inherit;
392 @ }
393 @ td.difftxt del > del {
394 @ background-color: #cc5555;
395 @ color: #000000;
396 @ text-decoration: none;
397 @ font-weight: bold;
398 @ }
399 @ td.difftxt del > del.edit {
400 @ background-color: #c0c0ff;
401 @ text-decoration: none;
402 @ font-weight: bold;
403 @ }
404 @ td.difftxt ins {
405 @ background-color: #a2dbb2;
406 @ color: #000000;
407 @ text-decoration: none;
408 @ line-height: inherit;
409 @ font-size: inherit;
410 @ }
411 @ td.difftxt ins > ins {
412 @ background-color: #559855;
413 @ text-decoration: none;
414 @ font-weight: bold;
415 @ }
416 @ td.difftxt ins > ins.edit {
417 @ background-color: #c0c0ff;
418 @ text-decoration: none;
419 @ font-weight: bold;
420 @ }
421 @
422 @ </style>
423 @ </head>
424 @ <body>
425 ;
426 const char zWebpageEnd[] =
427 @ </body>
428 @ </html>
429 ;
@@ -378,11 +484,12 @@
484 #else
485 SetConsoleCtrlHandler(diff_console_ctrl_handler, TRUE);
486 #endif
487 }
488 if( (pCfg->diffFlags & DIFF_WEBPAGE)!=0 ){
489 fossil_print("%s",(pCfg->diffFlags & DIFF_DARKMODE)!=0 ? zWebpageHdrDark :
490 zWebpageHdr);
491 fflush(stdout);
492 }
493 }
494
495 /* Do any final output required by a diff and complete the diff
@@ -956,10 +1063,11 @@
1063 int i;
1064 Blob script;
1065 const char *zTempFile = 0;
1066 char *zCmd;
1067 const char *zTclsh;
1068 int bDarkMode = find_option("dark",0,0)!=0;
1069 blob_zero(&script);
1070 blob_appendf(&script, "set fossilcmd {| \"%/\" %s -tcl -i -v",
1071 g.nameOfExe, zSubCmd);
1072 find_option("tcl",0,0);
1073 find_option("html",0,0);
@@ -982,11 +1090,12 @@
1090 int j;
1091 blob_append(&script, " ", 1);
1092 for(j=0; z[j]; j++) blob_appendf(&script, "\\%03o", (unsigned char)z[j]);
1093 }
1094 }
1095 blob_appendf(&script, "}\nset darkmode %d\n", bDarkMode);
1096 blob_appendf(&script, "%s", builtin_file("diff.tcl", 0));
1097 if( zTempFile ){
1098 blob_write_to_file(&script, zTempFile);
1099 fossil_print("To see diff, run: %s \"%s\"\n", zTclsh, zTempFile);
1100 }else{
1101 #if defined(FOSSIL_ENABLE_TCL)
@@ -1078,10 +1187,11 @@
1187 ** --by Shorthand for "--browser -y"
1188 ** -ci|--checkin VERSION Show diff of all changes in VERSION
1189 ** --command PROG External diff program. Overrides "diff-command"
1190 ** -c|--context N Show N lines of context around each change, with
1191 ** negative N meaning show all content
1192 ** --dark Use dark mode for the TCL/TK-based GUI and HTML
1193 ** --diff-binary BOOL Include binary files with external commands
1194 ** --exec-abs-paths Force absolute path names on external commands
1195 ** --exec-rel-paths Force relative path names on external commands
1196 ** -r|--from VERSION Select VERSION as source for the diff
1197 ** -w|--ignore-all-space Ignore white space when comparing lines
1198

Keyboard Shortcuts

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