Fossil

Check-in [c5ac4f80]
Login

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

Overview
Comment:Updated comments. Slightly more centralization of sbsdiff table generation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | jan-sbsdiff
Files: files | file ages | folders
SHA1:c5ac4f800e3ba241933a903f6842e5f4536103a2
User & Date: jan 2011-10-15 14:33:14
Context
2011-10-15
15:42
Merge the latest trunk changes into the side-by-side diff branch. check-in: 15de70c2 user: drh tags: jan-sbsdiff
14:33
Updated comments. Slightly more centralization of sbsdiff table generation. check-in: c5ac4f80 user: jan tags: jan-sbsdiff
12:49
Fix bug which disabled patch file generation. check-in: dc27e134 user: jan tags: jan-sbsdiff
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/diff.c.

647
648
649
650
651
652
653

654
655
656
657
658
659
660
  /* Compute the difference */
  diff_all(&c);

  linebuf = fossil_malloc(LENGTH_MASK+1);
  if( !linebuf ){
    free(c.aFrom);
    free(c.aTo);

    return 0;
  }

  iFrom=iTo=0;
  i=0;
  while( i<c.nEdit ){
    int j;







>







647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
  /* Compute the difference */
  diff_all(&c);

  linebuf = fossil_malloc(LENGTH_MASK+1);
  if( !linebuf ){
    free(c.aFrom);
    free(c.aTo);
    free(c.aEdit);
    return 0;
  }

  iFrom=iTo=0;
  i=0;
  while( i<c.nEdit ){
    int j;

Changes to src/info.c.

295
296
297
298
299
300
301



302

303
304
305
306
307
308
309
...
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
....
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
....
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
  }
  if( zTo ){
    toid = uuid_to_rid(zTo, 0);
    content_get(toid, &to);
  }else{
    blob_zero(&to);
  }



  html_sbsdiff(&from, &to, 5, 1);

  blob_reset(&from);
  blob_reset(&to);
}


/*
** Write a line of web-page output that shows changes that have occurred 
................................................................................
      @ version <a href="%s(g.zTop)/artifact/%s(zOld)">[%S(zOld)]</a>
    }else{
      @ <p>Added <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
      @ version <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)]</a>
    }
    if( showDiff ){
      if( sideBySide ){
         @ <table class="sbsdiff">
         @ <tr><th colspan="2" class="diffhdr">Old (%S(zOld))</th><th/>
         @ <th colspan="2" class="diffhdr">New (%S(zNew))</th></tr>
         generate_sbsdiff(zOld, zNew);
         @ </table>
      }else{
        @ <blockquote><pre>
        append_diff(zOld, zNew);
        @ </pre></blockquote>
      }
    }else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
      @ &nbsp;&nbsp;
................................................................................
    @ <a href="%s(g.zTop)/artifact/%S(zUuid)">[view]</a>
  }
}


/*
** WEBPAGE: fdiff
** URL: fdiff?v1=UUID&v2=UUID&patch
**
** Two arguments, v1 and v2, identify the files to be diffed.  Show the 
** difference between the two artifacts.  Generate plaintext if "patch"
** is present.
*/
void diff_page(void){
  int v1, v2;
  int isPatch;
  int sideBySide;
  Blob c1, c2, diff, *pOut;
  char *zV1;
................................................................................
    @ <h2>Differences From
    @ Artifact <a href="%s(g.zTop)/artifact/%S(zV1)">[%S(zV1)]</a>:</h2>
    object_description(v1, 0, 0);
    @ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
    object_description(v2, 0, 0);
    @ <hr />
    if( sideBySide ){
      @ <table class="sbsdiff">
      @ <tr><th colspan="2" class="diffhdr">Old (%S(zV1))</th><th/>
      @ <th colspan="2" class="diffhdr">New (%S(zV2))</th></tr>
      generate_sbsdiff(zV1, zV2);
      @ </table>
    }else{
      @ <blockquote><pre>
      @ %h(blob_str(&diff))
      @ </pre></blockquote>
    }
    blob_reset(&diff);
    style_footer();







>
>
>

>







 







<
<
<

<







 







|

|
|
|







 







<
<
<

<







295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
...
359
360
361
362
363
364
365



366

367
368
369
370
371
372
373
....
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
....
1068
1069
1070
1071
1072
1073
1074



1075

1076
1077
1078
1079
1080
1081
1082
  }
  if( zTo ){
    toid = uuid_to_rid(zTo, 0);
    content_get(toid, &to);
  }else{
    blob_zero(&to);
  }
  @ <table class="sbsdiff">
  @ <tr><th colspan="2" class="diffhdr">Old (%S(zFrom))</th><th/>
  @ <th colspan="2" class="diffhdr">New (%S(zTo))</th></tr>
  html_sbsdiff(&from, &to, 5, 1);
  @ </table>
  blob_reset(&from);
  blob_reset(&to);
}


/*
** Write a line of web-page output that shows changes that have occurred 
................................................................................
      @ version <a href="%s(g.zTop)/artifact/%s(zOld)">[%S(zOld)]</a>
    }else{
      @ <p>Added <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
      @ version <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)]</a>
    }
    if( showDiff ){
      if( sideBySide ){



         generate_sbsdiff(zOld, zNew);

      }else{
        @ <blockquote><pre>
        append_diff(zOld, zNew);
        @ </pre></blockquote>
      }
    }else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
      @ &nbsp;&nbsp;
................................................................................
    @ <a href="%s(g.zTop)/artifact/%S(zUuid)">[view]</a>
  }
}


/*
** WEBPAGE: fdiff
** URL: fdiff?v1=UUID&v2=UUID&patch&sbs=BOOLEAN
**
** Two arguments, v1 and v2, identify the files to be diffed.  Show the
** difference between the two artifacts.  Show diff side by side unless sbs
** is 0.  Generate plaintext if "patch" is present.
*/
void diff_page(void){
  int v1, v2;
  int isPatch;
  int sideBySide;
  Blob c1, c2, diff, *pOut;
  char *zV1;
................................................................................
    @ <h2>Differences From
    @ Artifact <a href="%s(g.zTop)/artifact/%S(zV1)">[%S(zV1)]</a>:</h2>
    object_description(v1, 0, 0);
    @ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
    object_description(v2, 0, 0);
    @ <hr />
    if( sideBySide ){



      generate_sbsdiff(zV1, zV2);

    }else{
      @ <blockquote><pre>
      @ %h(blob_str(&diff))
      @ </pre></blockquote>
    }
    blob_reset(&diff);
    style_footer();