Fossil SCM
On /timeline with files, hyperlink from the file to the corresponding artifact text.
Commit
9472cb5602764151fd4030ae07464e8ece76055f
Parent
45127a7236e4c34…
1 file changed
+11
-8
+11
-8
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -522,11 +522,12 @@ | ||
| 522 | 522 | int fid = db_column_int(&fchngQuery, 1); |
| 523 | 523 | int isDel = fid==0; |
| 524 | 524 | const char *zOldName = db_column_text(&fchngQuery, 5); |
| 525 | 525 | const char *zOld = db_column_text(&fchngQuery, 4); |
| 526 | 526 | const char *zNew = db_column_text(&fchngQuery, 3); |
| 527 | - const char *zUnpubTag = ""; | |
| 527 | + const char *zUnpub = ""; | |
| 528 | + char *zA; | |
| 528 | 529 | char zId[20]; |
| 529 | 530 | if( !inUl ){ |
| 530 | 531 | @ <ul class="filelist"> |
| 531 | 532 | inUl = 1; |
| 532 | 533 | } |
| @@ -539,29 +540,31 @@ | ||
| 539 | 540 | if( !isNew && !isDel && zOldName!=0 ){ |
| 540 | 541 | @ <li> %h(zOldName) → %h(zFilename)%s(zId) |
| 541 | 542 | } |
| 542 | 543 | continue; |
| 543 | 544 | } |
| 545 | + zA = href("%R/artifact/%S",fid?zNew:zOld); | |
| 544 | 546 | if( content_is_private(fid) ){ |
| 545 | - zUnpubTag = UNPUB_TAG; | |
| 547 | + zUnpub = UNPUB_TAG; | |
| 546 | 548 | } |
| 547 | 549 | if( isNew ){ |
| 548 | - @ <li> %h(zFilename)%s(zId) %s(zUnpubTag) (new file) | |
| 550 | + @ <li> %s(zA)%h(zFilename)</a>%s(zId) %s(zUnpub) (new file) | |
| 549 | 551 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 550 | 552 | }else if( isDel ){ |
| 551 | - @ <li> %h(zFilename) (deleted)</li> | |
| 553 | + @ <li> %s(zA)%h(zFilename)</a> (deleted)</li> | |
| 552 | 554 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 553 | - @ <li> %h(zOldName) → %h(zFilename)%s(zId) %s(zUnpubTag) | |
| 554 | - @ %z(href("%R/artifact/%s",zNew))[view]</a></li> | |
| 555 | + @ <li> %h(zOldName) → %s(zA)%h(zFilename)</a>%s(zId) | |
| 556 | + @ %s(zUnpub) %z(href("%R/artifact/%s",zNew))[view]</a></li> | |
| 555 | 557 | }else{ |
| 556 | 558 | if( zOldName!=0 ){ |
| 557 | - @ <li> %h(zOldName) → %h(zFilename)%s(zId) %s(zUnpubTag) | |
| 559 | + @ <li>%h(zOldName) → %s(zA)%h(zFilename)%s(zId)</a> %s(zUnpub) | |
| 558 | 560 | }else{ |
| 559 | - @ <li> %h(zFilename)%s(zId) %s(zUnpubTag) | |
| 561 | + @ <li>%s(zA)%h(zFilename)</a>%s(zId) %s(zUnpub) | |
| 560 | 562 | } |
| 561 | 563 | @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li> |
| 562 | 564 | } |
| 565 | + fossil_free(zA); | |
| 563 | 566 | } |
| 564 | 567 | db_reset(&fchngQuery); |
| 565 | 568 | if( inUl ){ |
| 566 | 569 | @ </ul> |
| 567 | 570 | } |
| 568 | 571 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -522,11 +522,12 @@ | |
| 522 | int fid = db_column_int(&fchngQuery, 1); |
| 523 | int isDel = fid==0; |
| 524 | const char *zOldName = db_column_text(&fchngQuery, 5); |
| 525 | const char *zOld = db_column_text(&fchngQuery, 4); |
| 526 | const char *zNew = db_column_text(&fchngQuery, 3); |
| 527 | const char *zUnpubTag = ""; |
| 528 | char zId[20]; |
| 529 | if( !inUl ){ |
| 530 | @ <ul class="filelist"> |
| 531 | inUl = 1; |
| 532 | } |
| @@ -539,29 +540,31 @@ | |
| 539 | if( !isNew && !isDel && zOldName!=0 ){ |
| 540 | @ <li> %h(zOldName) → %h(zFilename)%s(zId) |
| 541 | } |
| 542 | continue; |
| 543 | } |
| 544 | if( content_is_private(fid) ){ |
| 545 | zUnpubTag = UNPUB_TAG; |
| 546 | } |
| 547 | if( isNew ){ |
| 548 | @ <li> %h(zFilename)%s(zId) %s(zUnpubTag) (new file) |
| 549 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 550 | }else if( isDel ){ |
| 551 | @ <li> %h(zFilename) (deleted)</li> |
| 552 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 553 | @ <li> %h(zOldName) → %h(zFilename)%s(zId) %s(zUnpubTag) |
| 554 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 555 | }else{ |
| 556 | if( zOldName!=0 ){ |
| 557 | @ <li> %h(zOldName) → %h(zFilename)%s(zId) %s(zUnpubTag) |
| 558 | }else{ |
| 559 | @ <li> %h(zFilename)%s(zId) %s(zUnpubTag) |
| 560 | } |
| 561 | @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li> |
| 562 | } |
| 563 | } |
| 564 | db_reset(&fchngQuery); |
| 565 | if( inUl ){ |
| 566 | @ </ul> |
| 567 | } |
| 568 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -522,11 +522,12 @@ | |
| 522 | int fid = db_column_int(&fchngQuery, 1); |
| 523 | int isDel = fid==0; |
| 524 | const char *zOldName = db_column_text(&fchngQuery, 5); |
| 525 | const char *zOld = db_column_text(&fchngQuery, 4); |
| 526 | const char *zNew = db_column_text(&fchngQuery, 3); |
| 527 | const char *zUnpub = ""; |
| 528 | char *zA; |
| 529 | char zId[20]; |
| 530 | if( !inUl ){ |
| 531 | @ <ul class="filelist"> |
| 532 | inUl = 1; |
| 533 | } |
| @@ -539,29 +540,31 @@ | |
| 540 | if( !isNew && !isDel && zOldName!=0 ){ |
| 541 | @ <li> %h(zOldName) → %h(zFilename)%s(zId) |
| 542 | } |
| 543 | continue; |
| 544 | } |
| 545 | zA = href("%R/artifact/%S",fid?zNew:zOld); |
| 546 | if( content_is_private(fid) ){ |
| 547 | zUnpub = UNPUB_TAG; |
| 548 | } |
| 549 | if( isNew ){ |
| 550 | @ <li> %s(zA)%h(zFilename)</a>%s(zId) %s(zUnpub) (new file) |
| 551 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 552 | }else if( isDel ){ |
| 553 | @ <li> %s(zA)%h(zFilename)</a> (deleted)</li> |
| 554 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 555 | @ <li> %h(zOldName) → %s(zA)%h(zFilename)</a>%s(zId) |
| 556 | @ %s(zUnpub) %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 557 | }else{ |
| 558 | if( zOldName!=0 ){ |
| 559 | @ <li>%h(zOldName) → %s(zA)%h(zFilename)%s(zId)</a> %s(zUnpub) |
| 560 | }else{ |
| 561 | @ <li>%s(zA)%h(zFilename)</a>%s(zId) %s(zUnpub) |
| 562 | } |
| 563 | @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li> |
| 564 | } |
| 565 | fossil_free(zA); |
| 566 | } |
| 567 | db_reset(&fchngQuery); |
| 568 | if( inUl ){ |
| 569 | @ </ul> |
| 570 | } |
| 571 |