Fossil SCM

Further improvements to the title of the ckout page.

drh 2024-12-10 19:18 trunk
Commit 726709d92ac74afde122c3dfec04c13cbeee73fd20f4fcfeb6e79c36e34cec5b
1 file changed +11 -4
+11 -4
--- src/info.c
+++ src/info.c
@@ -611,19 +611,19 @@
611611
** Show information about the current checkout. This page only functions
612612
** if the web server is run on a loopback interface (in other words, was
613613
** started using "fossil ui" or similar) from with on open check-out.
614614
*/
615615
void ckout_page(void){
616
- const char *zName = P("name");
617616
int vid;
618617
char *zHostname;
619618
char *zCwd;
620619
int diffType; /* 0: no diff, 1: unified, 2: side-by-side */
621620
DiffConfig DCfg,*pCfg; /* Diff details */
621
+ const char *zHome; /* Home directory */
622622
Stmt q;
623623
624
- if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){
624
+ if( !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){
625625
cgi_redirect("%R/home");
626626
return;
627627
}
628628
diffType = preferred_diff_type();
629629
pCfg = construct_diff_flags(diffType, &DCfg);
@@ -632,14 +632,21 @@
632632
vfile_check_signature(vid, CKSIG_ENOTFILE);
633633
db_protect_pop();
634634
style_set_current_feature("vinfo");
635635
zHostname = fossil_hostname();
636636
zCwd = file_getcwd(0,0);
637
+ zHome = fossil_getenv("HOME");
638
+ if( zHome ){
639
+ int nHome = (int)strlen(zHome);
640
+ if( strncmp(zCwd, zHome, nHome)==0 && zCwd[nHome]=='/' ){
641
+ zCwd = mprintf("~%s", zCwd+nHome);
642
+ }
643
+ }
637644
if( zHostname ){
638
- style_header("Checkout %h on %h", zCwd, zHostname);
645
+ style_header("%h on %h", zCwd, zHostname);
639646
}else{
640
- style_header("Checkout at %h", zCwd);
647
+ style_header("%h", zCwd);
641648
}
642649
render_checkin_context(vid, 0, 0, 0);
643650
db_prepare(&q,
644651
/* 0 1 2 3 4 5 6 */
645652
"SELECT pathname, deleted, chnged , rid==0, rid, islink, uuid"
646653
--- src/info.c
+++ src/info.c
@@ -611,19 +611,19 @@
611 ** Show information about the current checkout. This page only functions
612 ** if the web server is run on a loopback interface (in other words, was
613 ** started using "fossil ui" or similar) from with on open check-out.
614 */
615 void ckout_page(void){
616 const char *zName = P("name");
617 int vid;
618 char *zHostname;
619 char *zCwd;
620 int diffType; /* 0: no diff, 1: unified, 2: side-by-side */
621 DiffConfig DCfg,*pCfg; /* Diff details */
 
622 Stmt q;
623
624 if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){
625 cgi_redirect("%R/home");
626 return;
627 }
628 diffType = preferred_diff_type();
629 pCfg = construct_diff_flags(diffType, &DCfg);
@@ -632,14 +632,21 @@
632 vfile_check_signature(vid, CKSIG_ENOTFILE);
633 db_protect_pop();
634 style_set_current_feature("vinfo");
635 zHostname = fossil_hostname();
636 zCwd = file_getcwd(0,0);
 
 
 
 
 
 
 
637 if( zHostname ){
638 style_header("Checkout %h on %h", zCwd, zHostname);
639 }else{
640 style_header("Checkout at %h", zCwd);
641 }
642 render_checkin_context(vid, 0, 0, 0);
643 db_prepare(&q,
644 /* 0 1 2 3 4 5 6 */
645 "SELECT pathname, deleted, chnged , rid==0, rid, islink, uuid"
646
--- src/info.c
+++ src/info.c
@@ -611,19 +611,19 @@
611 ** Show information about the current checkout. This page only functions
612 ** if the web server is run on a loopback interface (in other words, was
613 ** started using "fossil ui" or similar) from with on open check-out.
614 */
615 void ckout_page(void){
 
616 int vid;
617 char *zHostname;
618 char *zCwd;
619 int diffType; /* 0: no diff, 1: unified, 2: side-by-side */
620 DiffConfig DCfg,*pCfg; /* Diff details */
621 const char *zHome; /* Home directory */
622 Stmt q;
623
624 if( !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){
625 cgi_redirect("%R/home");
626 return;
627 }
628 diffType = preferred_diff_type();
629 pCfg = construct_diff_flags(diffType, &DCfg);
@@ -632,14 +632,21 @@
632 vfile_check_signature(vid, CKSIG_ENOTFILE);
633 db_protect_pop();
634 style_set_current_feature("vinfo");
635 zHostname = fossil_hostname();
636 zCwd = file_getcwd(0,0);
637 zHome = fossil_getenv("HOME");
638 if( zHome ){
639 int nHome = (int)strlen(zHome);
640 if( strncmp(zCwd, zHome, nHome)==0 && zCwd[nHome]=='/' ){
641 zCwd = mprintf("~%s", zCwd+nHome);
642 }
643 }
644 if( zHostname ){
645 style_header("%h on %h", zCwd, zHostname);
646 }else{
647 style_header("%h", zCwd);
648 }
649 render_checkin_context(vid, 0, 0, 0);
650 db_prepare(&q,
651 /* 0 1 2 3 4 5 6 */
652 "SELECT pathname, deleted, chnged , rid==0, rid, islink, uuid"
653

Keyboard Shortcuts

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