Fossil SCM
Further improvements to the title of the ckout page.
Commit
726709d92ac74afde122c3dfec04c13cbeee73fd20f4fcfeb6e79c36e34cec5b
Parent
842daebb2220d4d…
1 file changed
+11
-4
+11
-4
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -611,19 +611,19 @@ | ||
| 611 | 611 | ** Show information about the current checkout. This page only functions |
| 612 | 612 | ** if the web server is run on a loopback interface (in other words, was |
| 613 | 613 | ** started using "fossil ui" or similar) from with on open check-out. |
| 614 | 614 | */ |
| 615 | 615 | void ckout_page(void){ |
| 616 | - const char *zName = P("name"); | |
| 617 | 616 | int vid; |
| 618 | 617 | char *zHostname; |
| 619 | 618 | char *zCwd; |
| 620 | 619 | int diffType; /* 0: no diff, 1: unified, 2: side-by-side */ |
| 621 | 620 | DiffConfig DCfg,*pCfg; /* Diff details */ |
| 621 | + const char *zHome; /* Home directory */ | |
| 622 | 622 | Stmt q; |
| 623 | 623 | |
| 624 | - if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){ | |
| 624 | + if( !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){ | |
| 625 | 625 | cgi_redirect("%R/home"); |
| 626 | 626 | return; |
| 627 | 627 | } |
| 628 | 628 | diffType = preferred_diff_type(); |
| 629 | 629 | pCfg = construct_diff_flags(diffType, &DCfg); |
| @@ -632,14 +632,21 @@ | ||
| 632 | 632 | vfile_check_signature(vid, CKSIG_ENOTFILE); |
| 633 | 633 | db_protect_pop(); |
| 634 | 634 | style_set_current_feature("vinfo"); |
| 635 | 635 | zHostname = fossil_hostname(); |
| 636 | 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 | + } | |
| 637 | 644 | if( zHostname ){ |
| 638 | - style_header("Checkout %h on %h", zCwd, zHostname); | |
| 645 | + style_header("%h on %h", zCwd, zHostname); | |
| 639 | 646 | }else{ |
| 640 | - style_header("Checkout at %h", zCwd); | |
| 647 | + style_header("%h", zCwd); | |
| 641 | 648 | } |
| 642 | 649 | render_checkin_context(vid, 0, 0, 0); |
| 643 | 650 | db_prepare(&q, |
| 644 | 651 | /* 0 1 2 3 4 5 6 */ |
| 645 | 652 | "SELECT pathname, deleted, chnged , rid==0, rid, islink, uuid" |
| 646 | 653 |
| --- 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 |