Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:The various "diff --tk" commands now take an optional, undocumented option "--script FILENAME" that causes the Tk script to be written into FILENAME rather than to be run. One use for this is to get a copy of the diff script in a form were it can be easily edited and enhanced before being moved back into Fossil.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkdiff-enhancements
Files: files | file ages | folders
SHA1:326a736493e4bd8eb00fbb33eb9d7c341c3ae6d7
User & Date: drh 2013-09-27 14:41:14
Context
2013-09-28
10:34
Merge recent trunk changes into the tkdiff-enhancements branch. Closed-Leaf check-in: fac10931 user: drh tags: tkdiff-enhancements
2013-09-27
14:41
The various "diff --tk" commands now take an optional, undocumented option "--script FILENAME" that causes the Tk script to be written into FILENAME rather than to be run. One use for this is to get a copy of the diff script in a form were it can be easily edited and enhanced before being moved back into Fossil. check-in: 326a7364 user: drh tags: tkdiff-enhancements
2013-09-23
10:17
Prevent a crash in fossil during exit, when a mingw-compiled (with dw2) Tcl version is still loaded. This is clearly a dw2 bug (see: http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724), but the suggested workaround works and is managable. check-in: da96f916 user: jan.nijtmans tags: trunk
Changes

Changes to src/diffcmd.c.

913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930





931
932
933
934
935




936
937
938
939
940


941
942
943
944
945
946
947
** (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.
*/
void diff_tk(const char *zSubCmd, int firstArg){
  int i;
  Blob script;
  char *zTempFile;
  char *zCmd;
  blob_zero(&script);
  blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v",
               g.nameOfExe, zSubCmd);
  for(i=firstArg; i<g.argc; i++){
    const char *z = g.argv[i];
    if( z[0]=='-' ){
      if( strglob("*-html",z) ) continue;
      if( strglob("*-y",z) ) continue;
      if( strglob("*-i",z) ) continue;





    }
    blob_append(&script, " ", 1);
    shell_escape(&script, z);
  }
  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){







|










>
>
>
>
>





>
>
>
>
|
|
|
|
|
>
>







913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
** (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.
*/
void diff_tk(const char *zSubCmd, int firstArg){
  int i;
  Blob script;
  char *zTempFile = 0;
  char *zCmd;
  blob_zero(&script);
  blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v",
               g.nameOfExe, zSubCmd);
  for(i=firstArg; i<g.argc; i++){
    const char *z = g.argv[i];
    if( z[0]=='-' ){
      if( strglob("*-html",z) ) continue;
      if( strglob("*-y",z) ) continue;
      if( strglob("*-i",z) ) continue;
      if( strglob("*-script",z) && i<g.argc-1 ){
        i++;
        zTempFile = g.argv[i];
        continue;
      }
    }
    blob_append(&script, " ", 1);
    shell_escape(&script, z);
  }
  blob_appendf(&script, "}\n%s", zDiffScript);
  if( zTempFile ){
    blob_write_to_file(&script, zTempFile);
    fossil_print("To see diff, run: tclsh \"%s\"\n", zTempFile);
  }else{
    zTempFile = write_blob_to_temp_file(&script);
    zCmd = mprintf("tclsh \"%s\"", zTempFile);
    fossil_system(zCmd);
    file_delete(zTempFile);
    fossil_free(zCmd);
  }
  blob_reset(&script);
}

/*
** Returns non-zero if files that may be binary should be used with external
** diff programs.
*/
int diff_include_binary_files(void){