615
616
617
618
619
620
621
622
623
624
625
626
627
628
|
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
|
+
|
@ .t tag config ln -foreground gray
@ .t tag config chng -background {#d0d0ff}
@ .t tag config add -background {#c0ffc0}
@ .t tag config rm -background {#ffc0c0}
@ proc dehtml {x} {
@ return [string map {& & < < > > ' ' " \"} $x]
@ }
@ # puts $cmd
@ set in [open $cmd r]
@ while {![eof $in]} {
@ set line [gets $in]
@ if {[regexp {^<a name="chunk.*"></a>} $line]} continue
@ if {[regexp {^===} $line]} {
@ set n [string length $line]
@ if {$n>$mx} {set mx $n}
|
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
|
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
|
-
+
-
-
-
+
+
+
+
+
+
|
** to the diff command.
**
** Steps:
** (1) Write the Tcl/Tk script used for rendering into a temp file.
** (2) Invoke "wish" on the temp file using fossil_system().
** (3) Delete the temp file.
*/
static void diff_tk(void){
void diff_tk(const char *zSubCmd, int firstArg){
int i;
Blob script;
char *zTempFile;
char *zCmd;
blob_zero(&script);
blob_appendf(&script, "set cmd {| \"%/\" diff --html -y -i", g.nameOfExe);
for(i=2; i<g.argc; i++){
blob_appendf(&script, " \"%s\"", g.argv[i]);
blob_appendf(&script, "set cmd {| \"%/\" %s --html -y -i",
g.nameOfExe, zSubCmd);
for(i=firstArg; i<g.argc; i++){
blob_append(&script, " ", 1);
shell_escape(&script, g.argv[i]);
}
blob_appendf(&script, "}\n%s", zDiffScript);
zTempFile = write_blob_to_temp_file(&script);
zCmd = mprintf("tclsh \"%s\"", zTempFile);
fossil_system(zCmd);
file_delete(zTempFile);
fossil_free(zCmd);
}
/*
** Returns non-zero if files that may be binary should be used with external
** diff programs.
*/
int diff_include_binary_files(void){
|
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
|
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
|
-
+
|
const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
const char *zBinGlob = 0; /* Treat file names matching this as binary */
int fIncludeBinary = 0; /* Include binary files for external diff */
u64 diffFlags = 0; /* Flags to control the DIFF */
int f;
if( find_option("tk",0,0)!=0 ){
diff_tk();
diff_tk("diff", 2);
return;
}
isGDiff = g.argv[1][0]=='g';
isInternDiff = find_option("internal","i",0)!=0;
zFrom = find_option("from", "r", 1);
zTo = find_option("to", 0, 1);
zBranch = find_option("branch", 0, 1);
|