Fossil SCM
Add a "diff" hyperlink after each file in the "Show Files" view of the timeline.
Commit
6d9bba56dcdcad806a2e8672fe3835d04fad76c2
Parent
602d5f9cde9ce75…
1 file changed
+12
-4
+12
-4
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -344,17 +344,19 @@ | ||
| 344 | 344 | if( xExtra ){ |
| 345 | 345 | xExtra(rid); |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /* Generate the file-change list if requested */ |
| 349 | - if( (tmFlags & TIMELINE_FCHANGES)!=0 && zType[0]=='c' ){ | |
| 349 | + if( (tmFlags & TIMELINE_FCHANGES)!=0 && zType[0]=='c' && g.okHistory ){ | |
| 350 | 350 | int inUl = 0; |
| 351 | 351 | if( !fchngQueryInit ){ |
| 352 | 352 | db_prepare(&fchngQuery, |
| 353 | 353 | "SELECT (pid==0) AS isnew," |
| 354 | 354 | " (fid==0) AS isdel," |
| 355 | - " (SELECT name FROM filename WHERE fnid=mlink.fnid) AS name" | |
| 355 | + " (SELECT name FROM filename WHERE fnid=mlink.fnid) AS name," | |
| 356 | + " (SELECT uuid FROM blob WHERE rid=fid)," | |
| 357 | + " (SELECT uuid FROM blob WHERE rid=pid)" | |
| 356 | 358 | " FROM mlink" |
| 357 | 359 | " WHERE mid=:mid AND pid!=fid" |
| 358 | 360 | " ORDER BY 3" |
| 359 | 361 | ); |
| 360 | 362 | fchngQueryInit = 1; |
| @@ -362,20 +364,26 @@ | ||
| 362 | 364 | db_bind_int(&fchngQuery, ":mid", rid); |
| 363 | 365 | while( db_step(&fchngQuery)==SQLITE_ROW ){ |
| 364 | 366 | const char *zFilename = db_column_text(&fchngQuery, 2); |
| 365 | 367 | int isNew = db_column_int(&fchngQuery, 0); |
| 366 | 368 | int isDel = db_column_int(&fchngQuery, 1); |
| 369 | + const char *zOld = db_column_text(&fchngQuery, 4); | |
| 370 | + const char *zNew = db_column_text(&fchngQuery, 3); | |
| 367 | 371 | if( !inUl ){ |
| 368 | 372 | @ <ul class="filelist"> |
| 369 | 373 | inUl = 1; |
| 370 | 374 | } |
| 371 | 375 | if( isNew ){ |
| 372 | - @ <li> %h(zFilename) (new file)</li> | |
| 376 | + @ <li> %h(zFilename) (new file) | |
| 377 | + @ <a href="%s(g.zTop)/artifact/%S(zNew)" target="diffwindow">[view] | |
| 378 | + @ </a></li> | |
| 373 | 379 | }else if( isDel ){ |
| 374 | 380 | @ <li> %h(zFilename) (deleted)</li> |
| 375 | 381 | }else{ |
| 376 | - @ <li> %h(zFilename) </li> | |
| 382 | + @ <li> %h(zFilename) | |
| 383 | + @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&v2=%S(zNew)" | |
| 384 | + @ target="diffwindow">[diff]</a></li> | |
| 377 | 385 | } |
| 378 | 386 | } |
| 379 | 387 | db_reset(&fchngQuery); |
| 380 | 388 | if( inUl ){ |
| 381 | 389 | @ </ul> |
| 382 | 390 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -344,17 +344,19 @@ | |
| 344 | if( xExtra ){ |
| 345 | xExtra(rid); |
| 346 | } |
| 347 | |
| 348 | /* Generate the file-change list if requested */ |
| 349 | if( (tmFlags & TIMELINE_FCHANGES)!=0 && zType[0]=='c' ){ |
| 350 | int inUl = 0; |
| 351 | if( !fchngQueryInit ){ |
| 352 | db_prepare(&fchngQuery, |
| 353 | "SELECT (pid==0) AS isnew," |
| 354 | " (fid==0) AS isdel," |
| 355 | " (SELECT name FROM filename WHERE fnid=mlink.fnid) AS name" |
| 356 | " FROM mlink" |
| 357 | " WHERE mid=:mid AND pid!=fid" |
| 358 | " ORDER BY 3" |
| 359 | ); |
| 360 | fchngQueryInit = 1; |
| @@ -362,20 +364,26 @@ | |
| 362 | db_bind_int(&fchngQuery, ":mid", rid); |
| 363 | while( db_step(&fchngQuery)==SQLITE_ROW ){ |
| 364 | const char *zFilename = db_column_text(&fchngQuery, 2); |
| 365 | int isNew = db_column_int(&fchngQuery, 0); |
| 366 | int isDel = db_column_int(&fchngQuery, 1); |
| 367 | if( !inUl ){ |
| 368 | @ <ul class="filelist"> |
| 369 | inUl = 1; |
| 370 | } |
| 371 | if( isNew ){ |
| 372 | @ <li> %h(zFilename) (new file)</li> |
| 373 | }else if( isDel ){ |
| 374 | @ <li> %h(zFilename) (deleted)</li> |
| 375 | }else{ |
| 376 | @ <li> %h(zFilename) </li> |
| 377 | } |
| 378 | } |
| 379 | db_reset(&fchngQuery); |
| 380 | if( inUl ){ |
| 381 | @ </ul> |
| 382 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -344,17 +344,19 @@ | |
| 344 | if( xExtra ){ |
| 345 | xExtra(rid); |
| 346 | } |
| 347 | |
| 348 | /* Generate the file-change list if requested */ |
| 349 | if( (tmFlags & TIMELINE_FCHANGES)!=0 && zType[0]=='c' && g.okHistory ){ |
| 350 | int inUl = 0; |
| 351 | if( !fchngQueryInit ){ |
| 352 | db_prepare(&fchngQuery, |
| 353 | "SELECT (pid==0) AS isnew," |
| 354 | " (fid==0) AS isdel," |
| 355 | " (SELECT name FROM filename WHERE fnid=mlink.fnid) AS name," |
| 356 | " (SELECT uuid FROM blob WHERE rid=fid)," |
| 357 | " (SELECT uuid FROM blob WHERE rid=pid)" |
| 358 | " FROM mlink" |
| 359 | " WHERE mid=:mid AND pid!=fid" |
| 360 | " ORDER BY 3" |
| 361 | ); |
| 362 | fchngQueryInit = 1; |
| @@ -362,20 +364,26 @@ | |
| 364 | db_bind_int(&fchngQuery, ":mid", rid); |
| 365 | while( db_step(&fchngQuery)==SQLITE_ROW ){ |
| 366 | const char *zFilename = db_column_text(&fchngQuery, 2); |
| 367 | int isNew = db_column_int(&fchngQuery, 0); |
| 368 | int isDel = db_column_int(&fchngQuery, 1); |
| 369 | const char *zOld = db_column_text(&fchngQuery, 4); |
| 370 | const char *zNew = db_column_text(&fchngQuery, 3); |
| 371 | if( !inUl ){ |
| 372 | @ <ul class="filelist"> |
| 373 | inUl = 1; |
| 374 | } |
| 375 | if( isNew ){ |
| 376 | @ <li> %h(zFilename) (new file) |
| 377 | @ <a href="%s(g.zTop)/artifact/%S(zNew)" target="diffwindow">[view] |
| 378 | @ </a></li> |
| 379 | }else if( isDel ){ |
| 380 | @ <li> %h(zFilename) (deleted)</li> |
| 381 | }else{ |
| 382 | @ <li> %h(zFilename) |
| 383 | @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&v2=%S(zNew)" |
| 384 | @ target="diffwindow">[diff]</a></li> |
| 385 | } |
| 386 | } |
| 387 | db_reset(&fchngQuery); |
| 388 | if( inUl ){ |
| 389 | @ </ul> |
| 390 |