Attachment "diff.c.diff" to
ticket [fd5f24a5ca]
added by
anonymous
2010-12-01 21:29:30.
Index: src/info.c
===================================================================
--- src/info.c
+++ src/info.c
@@ -281,42 +281,46 @@
const char *zNew, /* blob.uuid after change. NULL for deletes */
int showDiff /* Show edit diffs if true */
){
if( !g.okHistory ){
if( zNew==0 ){
- @ <p>Deleted %h(zName)</p>
+ @ <p class='deleted'>Deleted %h(zName)</p>
}else if( zOld==0 ){
- @ <p>Added %h(zName)</p>
+ @ <p class='added'>Added %h(zName)</p>
}else{
- @ <p>Changes to %h(zName)</p>
+ @ <p class='changed'>Changes to %h(zName)</p>
}
if( showDiff ){
- @ <blockquote><pre>
+ @ <blockquote><pre class='diff'>
append_diff(zOld, zNew);
@ </pre></blockquote>
}
}else{
if( zOld && zNew ){
- @ <p>Modified <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
+ @ <p class='modified'>Modified
+ @ <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
@ from <a href="%s(g.zTop)/artifact/%s(zOld)">[%S(zOld)]</a>
@ to <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)].</a>
+ if( !showDiff ){
+ @
+ @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&v2=%S(zNew)">[diff]</a>
+ }
+ @ </p>
}else if( zOld ){
- @ <p>Deleted <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
- @ version <a href="%s(g.zTop)/artifact/%s(zOld)">[%S(zOld)]</a>
+ @ <p class='deleted'>Deleted
+ @ <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
+ @ version <a href="%s(g.zTop)/artifact/%s(zOld)">[%S(zOld)]</a></p>
}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>
+ @ <p class='added'>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></p>
}
if( showDiff ){
- @ <blockquote><pre>
+ @ <blockquote><pre class='diff'>
append_diff(zOld, zNew);
@ </pre></blockquote>
- }else if( zOld && zNew ){
- @
- @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&v2=%S(zNew)">[diff]</a>
}
- @ </p>
}
}
/*
@@ -467,19 +471,19 @@
@ <div class="section">Changes</div>
showDiff = g.zPath[0]!='c';
if( db_get_boolean("show-version-diffs", 0)==0 ){
showDiff = !showDiff;
if( showDiff ){
- @ <a href="%s(g.zBaseURL)/vinfo/%T(zName)">[hide diffs]</a><br/>
+ @ <a href="%s(g.zBaseURL)/vinfo/%T(zName)">[hide diffs]</a><br />
}else{
- @ <a href="%s(g.zBaseURL)/ci/%T(zName)">[show diffs]</a><br/>
+ @ <a href="%s(g.zBaseURL)/ci/%T(zName)">[show diffs]</a><br />
}
}else{
if( showDiff ){
- @ <a href="%s(g.zBaseURL)/ci/%T(zName)">[hide diffs]</a><br/>
+ @ <a href="%s(g.zBaseURL)/ci/%T(zName)">[hide diffs]</a><br />
}else{
- @ <a href="%s(g.zBaseURL)/vinfo/%T(zName)">[show diffs]</a><br/>
+ @ <a href="%s(g.zBaseURL)/vinfo/%T(zName)">[show diffs]</a><br />
}
}
db_prepare(&q,
"SELECT name,"
" (SELECT uuid FROM blob WHERE rid=mlink.pid),"
@@ -922,11 +926,11 @@
@ <h2>To:</h2>
@ <blockquote><p>
object_description(v2, 1, 0);
@ </p></blockquote>
@ <hr />
- @ <blockquote><pre>
+ @ <blockquote><pre class='diff'>
content_get(v1, &c1);
content_get(v2, &c2);
blob_zero(&diff);
text_diff(&c1, &c2, &diff, 4, 1);
blob_reset(&c1);