Fossil SCM

Improvements to the /mlink webpage.

drh 2015-12-24 19:18 trunk
Commit fba948a391ff97a7a4382fd5ca44db0c669e4683
2 files changed +8 -5 +9 -5
+8 -5
--- src/finfo.c
+++ src/finfo.c
@@ -600,37 +600,40 @@
600600
/* 9 */ " isaux"
601601
" FROM mlink WHERE mid=%d ORDER BY 1",
602602
mid
603603
);
604604
@ <h1>MLINK table for check-in %h(zCI)</h1>
605
- showContext(mid);
605
+ render_checkin_context(mid, 1);
606606
@ <hr>
607607
@ <div class='brlist'>
608608
@ <table id='mlinktable'>
609609
@ <thead><tr>
610610
@ <th>File</th>
611611
@ <th>From</th>
612
+ @ <th>Merge?</th>
612613
@ <th>New</th>
613614
@ <th>Old</th>
614
- @ <th>Exec</th>
615
- @ <th>Renamed From</th>
615
+ @ <th>Exe Bit?</th>
616
+ @ <th>Prior Name</th>
616617
@ </tr></thead>
617618
@ <tbody>
618619
while( db_step(&q)==SQLITE_ROW ){
619620
const char *zName = db_column_text(&q,0);
620621
const char *zFid = db_column_text(&q,2);
621622
const char *zPid = db_column_text(&q,4);
622623
const char *zParent = db_column_text(&q,7);
623624
const char *zPrior = db_column_text(&q,5);
624625
int isExec = db_column_int(&q,8);
626
+ int isAux = db_column_int(&q,9);
625627
@ <tr>
626628
@ <td><a href='%R/finfo?name=%t(zName)'>%h(zName)</a></td>
627629
if( zParent ){
628630
@ <td><a href='%R/info/%!S(zPid)'>%S(zParent)</a></td>
629631
}else{
630632
@ <td><i>(New)</i></td>
631633
}
634
+ @ <td align='center'>%s(isAux?"&#x2713;":"")</td>
632635
if( zFid ){
633636
@ <td><a href='%R/info/%!S(zFid)'>%S(zFid)</a></td>
634637
}else{
635638
@ <td><i>(Deleted)</i></td>
636639
}
@@ -637,11 +640,11 @@
637640
if( zPid ){
638641
@ <td><a href='%R/info/%!S(zPid)'>%S(zPid)</a>
639642
}else{
640643
@ <td><i>(New)</i></td>
641644
}
642
- @ <td>%s(isExec?"X":"")</td>
645
+ @ <td align='center'>%s(isExec?"&#x2713;":"")</td>
643646
if( zPrior ){
644647
@ <td><a href='%R/finfo?name=%t(zPrior)'>%h(zPrior)</a></td>
645648
}else{
646649
@ <td></td>
647650
}
@@ -649,9 +652,9 @@
649652
}
650653
db_finalize(&q);
651654
@ </tbody>
652655
@ </table>
653656
@ </div>
654
- output_table_sorting_javascript("mlinktable","tttttt",1);
657
+ output_table_sorting_javascript("mlinktable","ttxtttt",1);
655658
}
656659
style_footer();
657660
}
658661
--- src/finfo.c
+++ src/finfo.c
@@ -600,37 +600,40 @@
600 /* 9 */ " isaux"
601 " FROM mlink WHERE mid=%d ORDER BY 1",
602 mid
603 );
604 @ <h1>MLINK table for check-in %h(zCI)</h1>
605 showContext(mid);
606 @ <hr>
607 @ <div class='brlist'>
608 @ <table id='mlinktable'>
609 @ <thead><tr>
610 @ <th>File</th>
611 @ <th>From</th>
 
612 @ <th>New</th>
613 @ <th>Old</th>
614 @ <th>Exec</th>
615 @ <th>Renamed From</th>
616 @ </tr></thead>
617 @ <tbody>
618 while( db_step(&q)==SQLITE_ROW ){
619 const char *zName = db_column_text(&q,0);
620 const char *zFid = db_column_text(&q,2);
621 const char *zPid = db_column_text(&q,4);
622 const char *zParent = db_column_text(&q,7);
623 const char *zPrior = db_column_text(&q,5);
624 int isExec = db_column_int(&q,8);
 
625 @ <tr>
626 @ <td><a href='%R/finfo?name=%t(zName)'>%h(zName)</a></td>
627 if( zParent ){
628 @ <td><a href='%R/info/%!S(zPid)'>%S(zParent)</a></td>
629 }else{
630 @ <td><i>(New)</i></td>
631 }
 
632 if( zFid ){
633 @ <td><a href='%R/info/%!S(zFid)'>%S(zFid)</a></td>
634 }else{
635 @ <td><i>(Deleted)</i></td>
636 }
@@ -637,11 +640,11 @@
637 if( zPid ){
638 @ <td><a href='%R/info/%!S(zPid)'>%S(zPid)</a>
639 }else{
640 @ <td><i>(New)</i></td>
641 }
642 @ <td>%s(isExec?"X":"")</td>
643 if( zPrior ){
644 @ <td><a href='%R/finfo?name=%t(zPrior)'>%h(zPrior)</a></td>
645 }else{
646 @ <td></td>
647 }
@@ -649,9 +652,9 @@
649 }
650 db_finalize(&q);
651 @ </tbody>
652 @ </table>
653 @ </div>
654 output_table_sorting_javascript("mlinktable","tttttt",1);
655 }
656 style_footer();
657 }
658
--- src/finfo.c
+++ src/finfo.c
@@ -600,37 +600,40 @@
600 /* 9 */ " isaux"
601 " FROM mlink WHERE mid=%d ORDER BY 1",
602 mid
603 );
604 @ <h1>MLINK table for check-in %h(zCI)</h1>
605 render_checkin_context(mid, 1);
606 @ <hr>
607 @ <div class='brlist'>
608 @ <table id='mlinktable'>
609 @ <thead><tr>
610 @ <th>File</th>
611 @ <th>From</th>
612 @ <th>Merge?</th>
613 @ <th>New</th>
614 @ <th>Old</th>
615 @ <th>Exe Bit?</th>
616 @ <th>Prior Name</th>
617 @ </tr></thead>
618 @ <tbody>
619 while( db_step(&q)==SQLITE_ROW ){
620 const char *zName = db_column_text(&q,0);
621 const char *zFid = db_column_text(&q,2);
622 const char *zPid = db_column_text(&q,4);
623 const char *zParent = db_column_text(&q,7);
624 const char *zPrior = db_column_text(&q,5);
625 int isExec = db_column_int(&q,8);
626 int isAux = db_column_int(&q,9);
627 @ <tr>
628 @ <td><a href='%R/finfo?name=%t(zName)'>%h(zName)</a></td>
629 if( zParent ){
630 @ <td><a href='%R/info/%!S(zPid)'>%S(zParent)</a></td>
631 }else{
632 @ <td><i>(New)</i></td>
633 }
634 @ <td align='center'>%s(isAux?"&#x2713;":"")</td>
635 if( zFid ){
636 @ <td><a href='%R/info/%!S(zFid)'>%S(zFid)</a></td>
637 }else{
638 @ <td><i>(Deleted)</i></td>
639 }
@@ -637,11 +640,11 @@
640 if( zPid ){
641 @ <td><a href='%R/info/%!S(zPid)'>%S(zPid)</a>
642 }else{
643 @ <td><i>(New)</i></td>
644 }
645 @ <td align='center'>%s(isExec?"&#x2713;":"")</td>
646 if( zPrior ){
647 @ <td><a href='%R/finfo?name=%t(zPrior)'>%h(zPrior)</a></td>
648 }else{
649 @ <td></td>
650 }
@@ -649,9 +652,9 @@
652 }
653 db_finalize(&q);
654 @ </tbody>
655 @ </table>
656 @ </div>
657 output_table_sorting_javascript("mlinktable","ttxtttt",1);
658 }
659 style_footer();
660 }
661
+9 -5
--- src/info.c
+++ src/info.c
@@ -295,22 +295,26 @@
295295
296296
/*
297297
** Show the context graph (immediate parents and children) for
298298
** check-in rid.
299299
*/
300
-void showContext(int rid){
300
+void render_checkin_context(int rid, int parentsOnly){
301301
Blob sql;
302302
Stmt q;
303303
blob_zero(&sql);
304304
blob_append(&sql, timeline_query_for_www(), -1);
305305
db_multi_exec(
306306
"CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
307307
"INSERT INTO ok VALUES(%d);"
308
- "INSERT OR IGNORE INTO ok SELECT pid FROM plink WHERE cid=%d;"
309
- "INSERT OR IGNORE INTO ok SELECT cid FROM plink WHERE pid=%d;",
310
- rid, rid, rid
308
+ "INSERT OR IGNORE INTO ok SELECT pid FROM plink WHERE cid=%d;",
309
+ rid, rid
311310
);
311
+ if( !parentsOnly ){
312
+ db_multi_exec(
313
+ "INSERT OR IGNORE INTO ok SELECT cid FROM plink WHERE pid=%d;", rid
314
+ );
315
+ }
312316
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
313317
db_prepare(&q, "%s", blob_sql_text(&sql));
314318
www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH, 0, 0, rid, 0);
315319
db_finalize(&q);
316320
}
@@ -690,11 +694,11 @@
690694
login_anonymous_available();
691695
}
692696
db_finalize(&q1);
693697
showTags(rid);
694698
@ <div class="section">Context</div>
695
- showContext(rid);
699
+ render_checkin_context(rid, 0);
696700
@ <div class="section">Changes</div>
697701
@ <div class="sectionmenu">
698702
verboseFlag = g.zPath[0]!='c';
699703
if( db_get_boolean("show-version-diffs", 0)==0 ){
700704
verboseFlag = !verboseFlag;
701705
--- src/info.c
+++ src/info.c
@@ -295,22 +295,26 @@
295
296 /*
297 ** Show the context graph (immediate parents and children) for
298 ** check-in rid.
299 */
300 void showContext(int rid){
301 Blob sql;
302 Stmt q;
303 blob_zero(&sql);
304 blob_append(&sql, timeline_query_for_www(), -1);
305 db_multi_exec(
306 "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
307 "INSERT INTO ok VALUES(%d);"
308 "INSERT OR IGNORE INTO ok SELECT pid FROM plink WHERE cid=%d;"
309 "INSERT OR IGNORE INTO ok SELECT cid FROM plink WHERE pid=%d;",
310 rid, rid, rid
311 );
 
 
 
 
 
312 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
313 db_prepare(&q, "%s", blob_sql_text(&sql));
314 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH, 0, 0, rid, 0);
315 db_finalize(&q);
316 }
@@ -690,11 +694,11 @@
690 login_anonymous_available();
691 }
692 db_finalize(&q1);
693 showTags(rid);
694 @ <div class="section">Context</div>
695 showContext(rid);
696 @ <div class="section">Changes</div>
697 @ <div class="sectionmenu">
698 verboseFlag = g.zPath[0]!='c';
699 if( db_get_boolean("show-version-diffs", 0)==0 ){
700 verboseFlag = !verboseFlag;
701
--- src/info.c
+++ src/info.c
@@ -295,22 +295,26 @@
295
296 /*
297 ** Show the context graph (immediate parents and children) for
298 ** check-in rid.
299 */
300 void render_checkin_context(int rid, int parentsOnly){
301 Blob sql;
302 Stmt q;
303 blob_zero(&sql);
304 blob_append(&sql, timeline_query_for_www(), -1);
305 db_multi_exec(
306 "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
307 "INSERT INTO ok VALUES(%d);"
308 "INSERT OR IGNORE INTO ok SELECT pid FROM plink WHERE cid=%d;",
309 rid, rid
 
310 );
311 if( !parentsOnly ){
312 db_multi_exec(
313 "INSERT OR IGNORE INTO ok SELECT cid FROM plink WHERE pid=%d;", rid
314 );
315 }
316 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
317 db_prepare(&q, "%s", blob_sql_text(&sql));
318 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH, 0, 0, rid, 0);
319 db_finalize(&q);
320 }
@@ -690,11 +694,11 @@
694 login_anonymous_available();
695 }
696 db_finalize(&q1);
697 showTags(rid);
698 @ <div class="section">Context</div>
699 render_checkin_context(rid, 0);
700 @ <div class="section">Changes</div>
701 @ <div class="sectionmenu">
702 verboseFlag = g.zPath[0]!='c';
703 if( db_get_boolean("show-version-diffs", 0)==0 ){
704 verboseFlag = !verboseFlag;
705

Keyboard Shortcuts

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