Fossil SCM

On /timeline with files, hyperlink from the file to the corresponding artifact text.

drh 2015-02-11 04:29 trunk
Commit 9472cb5602764151fd4030ae07464e8ece76055f
1 file changed +11 -8
+11 -8
--- src/timeline.c
+++ src/timeline.c
@@ -522,11 +522,12 @@
522522
int fid = db_column_int(&fchngQuery, 1);
523523
int isDel = fid==0;
524524
const char *zOldName = db_column_text(&fchngQuery, 5);
525525
const char *zOld = db_column_text(&fchngQuery, 4);
526526
const char *zNew = db_column_text(&fchngQuery, 3);
527
- const char *zUnpubTag = "";
527
+ const char *zUnpub = "";
528
+ char *zA;
528529
char zId[20];
529530
if( !inUl ){
530531
@ <ul class="filelist">
531532
inUl = 1;
532533
}
@@ -539,29 +540,31 @@
539540
if( !isNew && !isDel && zOldName!=0 ){
540541
@ <li> %h(zOldName) &rarr; %h(zFilename)%s(zId)
541542
}
542543
continue;
543544
}
545
+ zA = href("%R/artifact/%S",fid?zNew:zOld);
544546
if( content_is_private(fid) ){
545
- zUnpubTag = UNPUB_TAG;
547
+ zUnpub = UNPUB_TAG;
546548
}
547549
if( isNew ){
548
- @ <li> %h(zFilename)%s(zId) %s(zUnpubTag) (new file) &nbsp;
550
+ @ <li> %s(zA)%h(zFilename)</a>%s(zId) %s(zUnpub) (new file) &nbsp;
549551
@ %z(href("%R/artifact/%s",zNew))[view]</a></li>
550552
}else if( isDel ){
551
- @ <li> %h(zFilename) (deleted)</li>
553
+ @ <li> %s(zA)%h(zFilename)</a> (deleted)</li>
552554
}else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){
553
- @ <li> %h(zOldName) &rarr; %h(zFilename)%s(zId) %s(zUnpubTag)
554
- @ %z(href("%R/artifact/%s",zNew))[view]</a></li>
555
+ @ <li> %h(zOldName) &rarr; %s(zA)%h(zFilename)</a>%s(zId)
556
+ @ %s(zUnpub) %z(href("%R/artifact/%s",zNew))[view]</a></li>
555557
}else{
556558
if( zOldName!=0 ){
557
- @ <li> %h(zOldName) &rarr; %h(zFilename)%s(zId) %s(zUnpubTag)
559
+ @ <li>%h(zOldName) &rarr; %s(zA)%h(zFilename)%s(zId)</a> %s(zUnpub)
558560
}else{
559
- @ <li> %h(zFilename)%s(zId) &nbsp; %s(zUnpubTag)
561
+ @ <li>%s(zA)%h(zFilename)</a>%s(zId) &nbsp; %s(zUnpub)
560562
}
561563
@ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li>
562564
}
565
+ fossil_free(zA);
563566
}
564567
db_reset(&fchngQuery);
565568
if( inUl ){
566569
@ </ul>
567570
}
568571
--- 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) &rarr; %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) &nbsp;
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) &rarr; %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) &rarr; %h(zFilename)%s(zId) %s(zUnpubTag)
558 }else{
559 @ <li> %h(zFilename)%s(zId) &nbsp; %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) &rarr; %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) &nbsp;
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) &rarr; %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) &rarr; %s(zA)%h(zFilename)%s(zId)</a> %s(zUnpub)
560 }else{
561 @ <li>%s(zA)%h(zFilename)</a>%s(zId) &nbsp; %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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button