Fossil SCM

Show the "remote list" values on the /urllist page.

drh 2021-12-23 12:50 trunk
Commit 964ec660a26529ff989c6af0917edf3f5a655a4cfb1f5aa4aaf5f467b6354421
1 file changed +29 -1
+29 -1
--- src/stat.c
+++ src/stat.c
@@ -588,11 +588,11 @@
588588
);
589589
while( db_step(&q)==SQLITE_ROW ){
590590
const char *zURL = db_column_text(&q,0);
591591
UrlData x;
592592
if( cnt==0 ){
593
- @ <div class="section">Sync with these URLs</div>
593
+ @ <div class="section">Recently synced with these URLs</div>
594594
@ <table border='0' width='100%%'>
595595
}
596596
memset(&x, 0, sizeof(x));
597597
url_parse_local(zURL, URL_OMIT_USER, &x);
598598
@ <tr><td width='100%%'><a href='%h(x.canonical)'>%h(x.canonical)</a>
@@ -640,10 +640,38 @@
640640
}else{
641641
@ <td>&nbsp;</td>
642642
}
643643
@ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr>
644644
}
645
+ db_finalize(&q);
646
+ fossil_free(zPriorRepo);
647
+ if( cnt ){
648
+ @ </table>
649
+ total += cnt;
650
+ }
651
+
652
+ cnt = 0;
653
+ db_prepare(&q,
654
+ "SELECT"
655
+ " value,"
656
+ " substr(name,10),"
657
+ " datetime(mtime,'unixepoch')"
658
+ "FROM config\n"
659
+ "WHERE name GLOB 'sync-url:*'\n"
660
+ "ORDER BY 2"
661
+ );
662
+ while( db_step(&q)==SQLITE_ROW ){
663
+ const char *zUrl = db_column_text(&q, 0);
664
+ const char *zName = db_column_text(&q, 1);
665
+ if( cnt++==0 ){
666
+ @ <div class="section">Defined sync targets</div>
667
+ @ <table border='0' width='100%%'>
668
+ }
669
+ @ <tr><td>%h(zName)</td><td>&nbsp;&nbsp;</td>
670
+ @ <td width='95%%'><a href='%h(zUrl)'>%h(zUrl)</a></td>
671
+ @ <td><nobr>%h(db_column_text(&q,2))</nobr></td></tr>
672
+ }
645673
db_finalize(&q);
646674
fossil_free(zPriorRepo);
647675
if( cnt ){
648676
@ </table>
649677
total += cnt;
650678
--- src/stat.c
+++ src/stat.c
@@ -588,11 +588,11 @@
588 );
589 while( db_step(&q)==SQLITE_ROW ){
590 const char *zURL = db_column_text(&q,0);
591 UrlData x;
592 if( cnt==0 ){
593 @ <div class="section">Sync with these URLs</div>
594 @ <table border='0' width='100%%'>
595 }
596 memset(&x, 0, sizeof(x));
597 url_parse_local(zURL, URL_OMIT_USER, &x);
598 @ <tr><td width='100%%'><a href='%h(x.canonical)'>%h(x.canonical)</a>
@@ -640,10 +640,38 @@
640 }else{
641 @ <td>&nbsp;</td>
642 }
643 @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr>
644 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
645 db_finalize(&q);
646 fossil_free(zPriorRepo);
647 if( cnt ){
648 @ </table>
649 total += cnt;
650
--- src/stat.c
+++ src/stat.c
@@ -588,11 +588,11 @@
588 );
589 while( db_step(&q)==SQLITE_ROW ){
590 const char *zURL = db_column_text(&q,0);
591 UrlData x;
592 if( cnt==0 ){
593 @ <div class="section">Recently synced with these URLs</div>
594 @ <table border='0' width='100%%'>
595 }
596 memset(&x, 0, sizeof(x));
597 url_parse_local(zURL, URL_OMIT_USER, &x);
598 @ <tr><td width='100%%'><a href='%h(x.canonical)'>%h(x.canonical)</a>
@@ -640,10 +640,38 @@
640 }else{
641 @ <td>&nbsp;</td>
642 }
643 @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr>
644 }
645 db_finalize(&q);
646 fossil_free(zPriorRepo);
647 if( cnt ){
648 @ </table>
649 total += cnt;
650 }
651
652 cnt = 0;
653 db_prepare(&q,
654 "SELECT"
655 " value,"
656 " substr(name,10),"
657 " datetime(mtime,'unixepoch')"
658 "FROM config\n"
659 "WHERE name GLOB 'sync-url:*'\n"
660 "ORDER BY 2"
661 );
662 while( db_step(&q)==SQLITE_ROW ){
663 const char *zUrl = db_column_text(&q, 0);
664 const char *zName = db_column_text(&q, 1);
665 if( cnt++==0 ){
666 @ <div class="section">Defined sync targets</div>
667 @ <table border='0' width='100%%'>
668 }
669 @ <tr><td>%h(zName)</td><td>&nbsp;&nbsp;</td>
670 @ <td width='95%%'><a href='%h(zUrl)'>%h(zUrl)</a></td>
671 @ <td><nobr>%h(db_column_text(&q,2))</nobr></td></tr>
672 }
673 db_finalize(&q);
674 fossil_free(zPriorRepo);
675 if( cnt ){
676 @ </table>
677 total += cnt;
678

Keyboard Shortcuts

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