Fossil SCM

Begin adding the infrastructure for a /ckout webpage.

drh 2024-12-10 00:36 trunk
Commit c620a8c74c6f9c72a5049c9b6f8fd0134420112a921903f97caad1fa2929e0ff
1 file changed +29
+29
--- src/info.c
+++ src/info.c
@@ -602,10 +602,39 @@
602602
www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
603603
0, 0, 0, rid, 0, 0);
604604
db_finalize(&q);
605605
style_finish_page();
606606
}
607
+
608
+/*
609
+** WEBPAGE: ckout
610
+**
611
+** Show information about the current checkout. This page only functions
612
+** if the web server is run as loopback and is on an open check-out and
613
+** has no "name" parameter.
614
+*/
615
+void ckout_page(void){
616
+ const char *zName = P("name");
617
+ int vid;
618
+ char *zHostname;
619
+ char *zCwd;
620
+ if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){
621
+ webpage_notfound_error(0 /*works-like:""*/);
622
+ return;
623
+ }
624
+ vid = db_lget_int("checkout", 0);
625
+ style_set_current_feature("vinfo");
626
+ zHostname = fossil_hostname();
627
+ zCwd = file_getcwd(0,0);
628
+ if( zHostname ){
629
+ style_header("Checkout at %s:%s", zHostname, zCwd);
630
+ }else{
631
+ style_header("Checkout at %s", zCwd);
632
+ }
633
+ render_checkin_context(vid, 0, 0, 0);
634
+ style_finish_page();
635
+}
607636
608637
/*
609638
** WEBPAGE: vinfo
610639
** WEBPAGE: ci
611640
** URL: /ci/ARTIFACTID
612641
--- src/info.c
+++ src/info.c
@@ -602,10 +602,39 @@
602 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
603 0, 0, 0, rid, 0, 0);
604 db_finalize(&q);
605 style_finish_page();
606 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
608 /*
609 ** WEBPAGE: vinfo
610 ** WEBPAGE: ci
611 ** URL: /ci/ARTIFACTID
612
--- src/info.c
+++ src/info.c
@@ -602,10 +602,39 @@
602 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
603 0, 0, 0, rid, 0, 0);
604 db_finalize(&q);
605 style_finish_page();
606 }
607
608 /*
609 ** WEBPAGE: ckout
610 **
611 ** Show information about the current checkout. This page only functions
612 ** if the web server is run as loopback and is on an open check-out and
613 ** has no "name" parameter.
614 */
615 void ckout_page(void){
616 const char *zName = P("name");
617 int vid;
618 char *zHostname;
619 char *zCwd;
620 if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){
621 webpage_notfound_error(0 /*works-like:""*/);
622 return;
623 }
624 vid = db_lget_int("checkout", 0);
625 style_set_current_feature("vinfo");
626 zHostname = fossil_hostname();
627 zCwd = file_getcwd(0,0);
628 if( zHostname ){
629 style_header("Checkout at %s:%s", zHostname, zCwd);
630 }else{
631 style_header("Checkout at %s", zCwd);
632 }
633 render_checkin_context(vid, 0, 0, 0);
634 style_finish_page();
635 }
636
637 /*
638 ** WEBPAGE: vinfo
639 ** WEBPAGE: ci
640 ** URL: /ci/ARTIFACTID
641

Keyboard Shortcuts

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