Fossil SCM
Begin adding the infrastructure for a /ckout webpage.
Commit
c620a8c74c6f9c72a5049c9b6f8fd0134420112a921903f97caad1fa2929e0ff
Parent
de6f88a6f00fa85…
1 file changed
+29
+29
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -602,10 +602,39 @@ | ||
| 602 | 602 | www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL, |
| 603 | 603 | 0, 0, 0, rid, 0, 0); |
| 604 | 604 | db_finalize(&q); |
| 605 | 605 | style_finish_page(); |
| 606 | 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 | +} | |
| 607 | 636 | |
| 608 | 637 | /* |
| 609 | 638 | ** WEBPAGE: vinfo |
| 610 | 639 | ** WEBPAGE: ci |
| 611 | 640 | ** URL: /ci/ARTIFACTID |
| 612 | 641 |
| --- 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 |