Fossil SCM
In File Browser show the selected path and check-in/branch in page's title
Commit
bbd53c778a55f18cca112094e023aa35a4d8bd4d513b4f32b1efe8639e8b13ea
Parent
5c60071800e851f…
2 files changed
+50
-9
+29
-4
+50
-9
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -133,21 +133,18 @@ | ||
| 133 | 133 | Manifest *pM = 0; |
| 134 | 134 | const char *zSubdirLink; |
| 135 | 135 | int linkTrunk = 1; |
| 136 | 136 | int linkTip = 1; |
| 137 | 137 | HQuery sURI; |
| 138 | + int isSymbolicCI = 0; | |
| 139 | + char *zHeader = 0; | |
| 138 | 140 | |
| 141 | + if( zCI && strlen(zCI)==0 ){ zCI = 0; } | |
| 139 | 142 | if( strcmp(PD("type","flat"),"tree")==0 ){ page_tree(); return; } |
| 140 | 143 | login_check_credentials(); |
| 141 | 144 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 142 | 145 | while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; } |
| 143 | - style_header("File List"); | |
| 144 | - style_adunit_config(ADUNIT_RIGHT_OK); | |
| 145 | - sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0, | |
| 146 | - pathelementFunc, 0, 0); | |
| 147 | - url_initialize(&sURI, "dir"); | |
| 148 | - cgi_query_parameters_to_url(&sURI); | |
| 149 | 146 | |
| 150 | 147 | /* If the name= parameter is an empty string, make it a NULL pointer */ |
| 151 | 148 | if( zD && strlen(zD)==0 ){ zD = 0; } |
| 152 | 149 | |
| 153 | 150 | /* If a specific check-in is requested, fetch and parse it. If the |
| @@ -159,15 +156,37 @@ | ||
| 159 | 156 | if( pM ){ |
| 160 | 157 | int trunkRid = symbolic_name_to_rid("tag:trunk", "ci"); |
| 161 | 158 | linkTrunk = trunkRid && rid != trunkRid; |
| 162 | 159 | linkTip = rid != symbolic_name_to_rid("tip", "ci"); |
| 163 | 160 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 161 | + isSymbolicCI = (strncmp(zUuid, zCI, strlen(zCI)) != 0); | |
| 164 | 162 | }else{ |
| 165 | 163 | zCI = 0; |
| 166 | 164 | } |
| 167 | 165 | } |
| 168 | 166 | |
| 167 | + if( isSymbolicCI ) { | |
| 168 | + if( zCI && strlen(zCI) ){ | |
| 169 | + zHeader = mprintf("%s at %s", (zD ? zD : "Files"), zCI); | |
| 170 | + }else{ | |
| 171 | + zHeader = mprintf("%s", (zD ? zD : "All Files")); | |
| 172 | + } | |
| 173 | + }else{ | |
| 174 | + if( zUuid && strlen(zUuid) ){ | |
| 175 | + zHeader = mprintf("%s at [%S]", (zD ? zD : "Files"), zUuid); | |
| 176 | + }else{ | |
| 177 | + zHeader = mprintf("%s", (zD ? zD : "All Files")); | |
| 178 | + } | |
| 179 | + } | |
| 180 | + style_header("%s", zHeader); | |
| 181 | + fossil_free(zHeader); | |
| 182 | + style_adunit_config(ADUNIT_RIGHT_OK); | |
| 183 | + sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0, | |
| 184 | + pathelementFunc, 0, 0); | |
| 185 | + url_initialize(&sURI, "dir"); | |
| 186 | + cgi_query_parameters_to_url(&sURI); | |
| 187 | + | |
| 169 | 188 | /* Compute the title of the page */ |
| 170 | 189 | blob_zero(&dirname); |
| 171 | 190 | if( zD ){ |
| 172 | 191 | blob_append(&dirname, "in directory ", -1); |
| 173 | 192 | hyperlinked_path(zD, &dirname, zCI, "dir", ""); |
| @@ -611,11 +630,14 @@ | ||
| 611 | 630 | HQuery sURI; /* Hyperlink */ |
| 612 | 631 | int startExpanded; /* True to start out with the tree expanded */ |
| 613 | 632 | int showDirOnly; /* Show directories only. Omit files */ |
| 614 | 633 | int nDir = 0; /* Number of directories. Used for ID attributes */ |
| 615 | 634 | char *zProjectName = db_get("project-name", 0); |
| 635 | + int isSymbolicCI = 0; | |
| 636 | + char *zHeader = 0; | |
| 616 | 637 | |
| 638 | + if( zCI && strlen(zCI)==0 ){ zCI = 0; } | |
| 617 | 639 | if( strcmp(PD("type","flat"),"flat")==0 ){ page_dir(); return; } |
| 618 | 640 | memset(&sTree, 0, sizeof(sTree)); |
| 619 | 641 | login_check_credentials(); |
| 620 | 642 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 621 | 643 | while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; } |
| @@ -623,14 +645,12 @@ | ||
| 623 | 645 | pathelementFunc, 0, 0); |
| 624 | 646 | url_initialize(&sURI, "tree"); |
| 625 | 647 | cgi_query_parameters_to_url(&sURI); |
| 626 | 648 | if( PB("nofiles") ){ |
| 627 | 649 | showDirOnly = 1; |
| 628 | - style_header("Folder Hierarchy"); | |
| 629 | 650 | }else{ |
| 630 | 651 | showDirOnly = 0; |
| 631 | - style_header("File Tree"); | |
| 632 | 652 | } |
| 633 | 653 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 634 | 654 | if( PB("expand") ){ |
| 635 | 655 | startExpanded = 1; |
| 636 | 656 | }else{ |
| @@ -659,19 +679,40 @@ | ||
| 659 | 679 | linkTip = rid != symbolic_name_to_rid("tip", "ci"); |
| 660 | 680 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 661 | 681 | rNow = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); |
| 662 | 682 | zNow = db_text("", "SELECT datetime(mtime,toLocal())" |
| 663 | 683 | " FROM event WHERE objid=%d", rid); |
| 684 | + isSymbolicCI = (strncmp(zUuid, zCI, strlen(zCI)) != 0); | |
| 664 | 685 | }else{ |
| 665 | 686 | zCI = 0; |
| 666 | 687 | } |
| 667 | 688 | } |
| 668 | 689 | if( zCI==0 ){ |
| 669 | 690 | rNow = db_double(0.0, "SELECT max(mtime) FROM event"); |
| 670 | 691 | zNow = db_text("", "SELECT datetime(max(mtime),toLocal()) FROM event"); |
| 671 | 692 | } |
| 672 | 693 | |
| 694 | + if( isSymbolicCI ) { | |
| 695 | + if( zCI && strlen(zCI) ){ | |
| 696 | + zHeader = mprintf("%s at %s", | |
| 697 | + (zD ? zD : (showDirOnly ? "Folder Hierarchy" : "Tree-View")), zCI); | |
| 698 | + }else{ | |
| 699 | + zHeader = mprintf("%s", | |
| 700 | + (zD ? zD : (showDirOnly ? "All Folders Hierarchy" : "All Files Tree-View"))); | |
| 701 | + } | |
| 702 | + }else{ | |
| 703 | + if( zUuid && strlen(zUuid) ){ | |
| 704 | + zHeader = mprintf("%s at [%S]", | |
| 705 | + (zD ? zD : (showDirOnly ? "Folder Hierarchy" : "Tree-View")), zUuid); | |
| 706 | + }else{ | |
| 707 | + zHeader = mprintf("%s", | |
| 708 | + (zD ? zD : (showDirOnly ? "All Folders Hierarchy" : "All Files Tree-View"))); | |
| 709 | + } | |
| 710 | + } | |
| 711 | + style_header("%s", zHeader); | |
| 712 | + fossil_free(zHeader); | |
| 713 | + | |
| 673 | 714 | /* Compute the title of the page */ |
| 674 | 715 | blob_zero(&dirname); |
| 675 | 716 | if( zD ){ |
| 676 | 717 | blob_append(&dirname, "within directory ", -1); |
| 677 | 718 | hyperlinked_path(zD, &dirname, zCI, "tree", zREx); |
| @@ -757,11 +798,11 @@ | ||
| 757 | 798 | } |
| 758 | 799 | |
| 759 | 800 | style_submenu_checkbox("nofiles", "Folders Only", 0, 0); |
| 760 | 801 | |
| 761 | 802 | if( zCI ){ |
| 762 | - @ <h2>%s(zObjType) from | |
| 803 | + @ <h2>%s(zObjType) of check-in | |
| 763 | 804 | if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){ |
| 764 | 805 | @ "%h(zCI)" |
| 765 | 806 | } |
| 766 | 807 | @ [%z(href("vinfo?name=%!S",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname)) |
| 767 | 808 | }else{ |
| 768 | 809 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -133,21 +133,18 @@ | |
| 133 | Manifest *pM = 0; |
| 134 | const char *zSubdirLink; |
| 135 | int linkTrunk = 1; |
| 136 | int linkTip = 1; |
| 137 | HQuery sURI; |
| 138 | |
| 139 | if( strcmp(PD("type","flat"),"tree")==0 ){ page_tree(); return; } |
| 140 | login_check_credentials(); |
| 141 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 142 | while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; } |
| 143 | style_header("File List"); |
| 144 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 145 | sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0, |
| 146 | pathelementFunc, 0, 0); |
| 147 | url_initialize(&sURI, "dir"); |
| 148 | cgi_query_parameters_to_url(&sURI); |
| 149 | |
| 150 | /* If the name= parameter is an empty string, make it a NULL pointer */ |
| 151 | if( zD && strlen(zD)==0 ){ zD = 0; } |
| 152 | |
| 153 | /* If a specific check-in is requested, fetch and parse it. If the |
| @@ -159,15 +156,37 @@ | |
| 159 | if( pM ){ |
| 160 | int trunkRid = symbolic_name_to_rid("tag:trunk", "ci"); |
| 161 | linkTrunk = trunkRid && rid != trunkRid; |
| 162 | linkTip = rid != symbolic_name_to_rid("tip", "ci"); |
| 163 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 164 | }else{ |
| 165 | zCI = 0; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /* Compute the title of the page */ |
| 170 | blob_zero(&dirname); |
| 171 | if( zD ){ |
| 172 | blob_append(&dirname, "in directory ", -1); |
| 173 | hyperlinked_path(zD, &dirname, zCI, "dir", ""); |
| @@ -611,11 +630,14 @@ | |
| 611 | HQuery sURI; /* Hyperlink */ |
| 612 | int startExpanded; /* True to start out with the tree expanded */ |
| 613 | int showDirOnly; /* Show directories only. Omit files */ |
| 614 | int nDir = 0; /* Number of directories. Used for ID attributes */ |
| 615 | char *zProjectName = db_get("project-name", 0); |
| 616 | |
| 617 | if( strcmp(PD("type","flat"),"flat")==0 ){ page_dir(); return; } |
| 618 | memset(&sTree, 0, sizeof(sTree)); |
| 619 | login_check_credentials(); |
| 620 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 621 | while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; } |
| @@ -623,14 +645,12 @@ | |
| 623 | pathelementFunc, 0, 0); |
| 624 | url_initialize(&sURI, "tree"); |
| 625 | cgi_query_parameters_to_url(&sURI); |
| 626 | if( PB("nofiles") ){ |
| 627 | showDirOnly = 1; |
| 628 | style_header("Folder Hierarchy"); |
| 629 | }else{ |
| 630 | showDirOnly = 0; |
| 631 | style_header("File Tree"); |
| 632 | } |
| 633 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 634 | if( PB("expand") ){ |
| 635 | startExpanded = 1; |
| 636 | }else{ |
| @@ -659,19 +679,40 @@ | |
| 659 | linkTip = rid != symbolic_name_to_rid("tip", "ci"); |
| 660 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 661 | rNow = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); |
| 662 | zNow = db_text("", "SELECT datetime(mtime,toLocal())" |
| 663 | " FROM event WHERE objid=%d", rid); |
| 664 | }else{ |
| 665 | zCI = 0; |
| 666 | } |
| 667 | } |
| 668 | if( zCI==0 ){ |
| 669 | rNow = db_double(0.0, "SELECT max(mtime) FROM event"); |
| 670 | zNow = db_text("", "SELECT datetime(max(mtime),toLocal()) FROM event"); |
| 671 | } |
| 672 | |
| 673 | /* Compute the title of the page */ |
| 674 | blob_zero(&dirname); |
| 675 | if( zD ){ |
| 676 | blob_append(&dirname, "within directory ", -1); |
| 677 | hyperlinked_path(zD, &dirname, zCI, "tree", zREx); |
| @@ -757,11 +798,11 @@ | |
| 757 | } |
| 758 | |
| 759 | style_submenu_checkbox("nofiles", "Folders Only", 0, 0); |
| 760 | |
| 761 | if( zCI ){ |
| 762 | @ <h2>%s(zObjType) from |
| 763 | if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){ |
| 764 | @ "%h(zCI)" |
| 765 | } |
| 766 | @ [%z(href("vinfo?name=%!S",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname)) |
| 767 | }else{ |
| 768 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -133,21 +133,18 @@ | |
| 133 | Manifest *pM = 0; |
| 134 | const char *zSubdirLink; |
| 135 | int linkTrunk = 1; |
| 136 | int linkTip = 1; |
| 137 | HQuery sURI; |
| 138 | int isSymbolicCI = 0; |
| 139 | char *zHeader = 0; |
| 140 | |
| 141 | if( zCI && strlen(zCI)==0 ){ zCI = 0; } |
| 142 | if( strcmp(PD("type","flat"),"tree")==0 ){ page_tree(); return; } |
| 143 | login_check_credentials(); |
| 144 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 145 | while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; } |
| 146 | |
| 147 | /* If the name= parameter is an empty string, make it a NULL pointer */ |
| 148 | if( zD && strlen(zD)==0 ){ zD = 0; } |
| 149 | |
| 150 | /* If a specific check-in is requested, fetch and parse it. If the |
| @@ -159,15 +156,37 @@ | |
| 156 | if( pM ){ |
| 157 | int trunkRid = symbolic_name_to_rid("tag:trunk", "ci"); |
| 158 | linkTrunk = trunkRid && rid != trunkRid; |
| 159 | linkTip = rid != symbolic_name_to_rid("tip", "ci"); |
| 160 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 161 | isSymbolicCI = (strncmp(zUuid, zCI, strlen(zCI)) != 0); |
| 162 | }else{ |
| 163 | zCI = 0; |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | if( isSymbolicCI ) { |
| 168 | if( zCI && strlen(zCI) ){ |
| 169 | zHeader = mprintf("%s at %s", (zD ? zD : "Files"), zCI); |
| 170 | }else{ |
| 171 | zHeader = mprintf("%s", (zD ? zD : "All Files")); |
| 172 | } |
| 173 | }else{ |
| 174 | if( zUuid && strlen(zUuid) ){ |
| 175 | zHeader = mprintf("%s at [%S]", (zD ? zD : "Files"), zUuid); |
| 176 | }else{ |
| 177 | zHeader = mprintf("%s", (zD ? zD : "All Files")); |
| 178 | } |
| 179 | } |
| 180 | style_header("%s", zHeader); |
| 181 | fossil_free(zHeader); |
| 182 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 183 | sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0, |
| 184 | pathelementFunc, 0, 0); |
| 185 | url_initialize(&sURI, "dir"); |
| 186 | cgi_query_parameters_to_url(&sURI); |
| 187 | |
| 188 | /* Compute the title of the page */ |
| 189 | blob_zero(&dirname); |
| 190 | if( zD ){ |
| 191 | blob_append(&dirname, "in directory ", -1); |
| 192 | hyperlinked_path(zD, &dirname, zCI, "dir", ""); |
| @@ -611,11 +630,14 @@ | |
| 630 | HQuery sURI; /* Hyperlink */ |
| 631 | int startExpanded; /* True to start out with the tree expanded */ |
| 632 | int showDirOnly; /* Show directories only. Omit files */ |
| 633 | int nDir = 0; /* Number of directories. Used for ID attributes */ |
| 634 | char *zProjectName = db_get("project-name", 0); |
| 635 | int isSymbolicCI = 0; |
| 636 | char *zHeader = 0; |
| 637 | |
| 638 | if( zCI && strlen(zCI)==0 ){ zCI = 0; } |
| 639 | if( strcmp(PD("type","flat"),"flat")==0 ){ page_dir(); return; } |
| 640 | memset(&sTree, 0, sizeof(sTree)); |
| 641 | login_check_credentials(); |
| 642 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 643 | while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; } |
| @@ -623,14 +645,12 @@ | |
| 645 | pathelementFunc, 0, 0); |
| 646 | url_initialize(&sURI, "tree"); |
| 647 | cgi_query_parameters_to_url(&sURI); |
| 648 | if( PB("nofiles") ){ |
| 649 | showDirOnly = 1; |
| 650 | }else{ |
| 651 | showDirOnly = 0; |
| 652 | } |
| 653 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 654 | if( PB("expand") ){ |
| 655 | startExpanded = 1; |
| 656 | }else{ |
| @@ -659,19 +679,40 @@ | |
| 679 | linkTip = rid != symbolic_name_to_rid("tip", "ci"); |
| 680 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 681 | rNow = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); |
| 682 | zNow = db_text("", "SELECT datetime(mtime,toLocal())" |
| 683 | " FROM event WHERE objid=%d", rid); |
| 684 | isSymbolicCI = (strncmp(zUuid, zCI, strlen(zCI)) != 0); |
| 685 | }else{ |
| 686 | zCI = 0; |
| 687 | } |
| 688 | } |
| 689 | if( zCI==0 ){ |
| 690 | rNow = db_double(0.0, "SELECT max(mtime) FROM event"); |
| 691 | zNow = db_text("", "SELECT datetime(max(mtime),toLocal()) FROM event"); |
| 692 | } |
| 693 | |
| 694 | if( isSymbolicCI ) { |
| 695 | if( zCI && strlen(zCI) ){ |
| 696 | zHeader = mprintf("%s at %s", |
| 697 | (zD ? zD : (showDirOnly ? "Folder Hierarchy" : "Tree-View")), zCI); |
| 698 | }else{ |
| 699 | zHeader = mprintf("%s", |
| 700 | (zD ? zD : (showDirOnly ? "All Folders Hierarchy" : "All Files Tree-View"))); |
| 701 | } |
| 702 | }else{ |
| 703 | if( zUuid && strlen(zUuid) ){ |
| 704 | zHeader = mprintf("%s at [%S]", |
| 705 | (zD ? zD : (showDirOnly ? "Folder Hierarchy" : "Tree-View")), zUuid); |
| 706 | }else{ |
| 707 | zHeader = mprintf("%s", |
| 708 | (zD ? zD : (showDirOnly ? "All Folders Hierarchy" : "All Files Tree-View"))); |
| 709 | } |
| 710 | } |
| 711 | style_header("%s", zHeader); |
| 712 | fossil_free(zHeader); |
| 713 | |
| 714 | /* Compute the title of the page */ |
| 715 | blob_zero(&dirname); |
| 716 | if( zD ){ |
| 717 | blob_append(&dirname, "within directory ", -1); |
| 718 | hyperlinked_path(zD, &dirname, zCI, "tree", zREx); |
| @@ -757,11 +798,11 @@ | |
| 798 | } |
| 799 | |
| 800 | style_submenu_checkbox("nofiles", "Folders Only", 0, 0); |
| 801 | |
| 802 | if( zCI ){ |
| 803 | @ <h2>%s(zObjType) of check-in |
| 804 | if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){ |
| 805 | @ "%h(zCI)" |
| 806 | } |
| 807 | @ [%z(href("vinfo?name=%!S",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname)) |
| 808 | }else{ |
| 809 |
+29
-4
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2138,21 +2138,29 @@ | ||
| 2138 | 2138 | const char *zLn = P("ln"); |
| 2139 | 2139 | const char *zName = P("name"); |
| 2140 | 2140 | const char *zCI = P("ci"); |
| 2141 | 2141 | HQuery url; |
| 2142 | 2142 | Blob dirname; |
| 2143 | + char *zCIUuid = 0; | |
| 2144 | + int isSymbolicCI = 0; | |
| 2145 | + char *zHeader = 0; | |
| 2143 | 2146 | |
| 2147 | + if( zCI && strlen(zCI)==0 ){ zCI = 0; } | |
| 2144 | 2148 | if( zCI ){ |
| 2145 | 2149 | login_check_credentials(); |
| 2146 | 2150 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 2147 | 2151 | |
| 2148 | 2152 | blob_zero(&dirname); |
| 2149 | 2153 | hyperlinked_path(zName, &dirname, zCI, "dir", ""); |
| 2150 | 2154 | blob_reset(&dirname); |
| 2155 | + | |
| 2156 | + if( name_to_uuid2(zCI, "ci", &zCIUuid) ){ | |
| 2157 | + isSymbolicCI = (strncmp(zCIUuid, zCI, strlen(zCI)) != 0); | |
| 2158 | + } | |
| 2151 | 2159 | } |
| 2152 | 2160 | url_initialize(&url, g.zPath); |
| 2153 | - if( isFile&&zName ) { | |
| 2161 | + if( isFile && zName ) { | |
| 2154 | 2162 | rid = artifact_from_ci_and_filename(0, "name"); |
| 2155 | 2163 | }else{ |
| 2156 | 2164 | rid = artifact_from_ci_and_filename(&url, 0); |
| 2157 | 2165 | } |
| 2158 | 2166 | if( rid==0 ){ |
| @@ -2220,11 +2228,11 @@ | ||
| 2220 | 2228 | const char *zPath; |
| 2221 | 2229 | Blob path; |
| 2222 | 2230 | blob_zero(&path); |
| 2223 | 2231 | hyperlinked_path(zName, &path, zCI, "dir", ""); |
| 2224 | 2232 | zPath = blob_str(&path); |
| 2225 | - @ <h2>File %s(zPath) of check-in [%z(href("/info/%!S",zCI))%S(zCI)</a>] | |
| 2233 | + @ <h2>File %s(zPath) of check-in [%z(href("/info/%!S",zCIUuid))%S(zCIUuid)</a>] | |
| 2226 | 2234 | @ </h2> |
| 2227 | 2235 | blob_reset(&path); |
| 2228 | 2236 | }else{ |
| 2229 | 2237 | @ <h2>Latest version of file '%h(zName)':</h2> |
| 2230 | 2238 | } |
| @@ -2254,12 +2262,29 @@ | ||
| 2254 | 2262 | g.zTop, zUuid); |
| 2255 | 2263 | }else{ |
| 2256 | 2264 | style_submenu_element("Shun", "%s/shun?shun=%s#addshun", g.zTop, zUuid); |
| 2257 | 2265 | } |
| 2258 | 2266 | } |
| 2259 | - style_header("%s", isFile ? "File Content" : | |
| 2260 | - descOnly ? "Artifact Description" : "Artifact Content"); | |
| 2267 | + | |
| 2268 | + if( isFile ){ | |
| 2269 | + if( zCI ){ | |
| 2270 | + if( isSymbolicCI ){ | |
| 2271 | + zHeader = mprintf("%s at %s", file_tail(zName), zCI); | |
| 2272 | + }else{ | |
| 2273 | + zHeader = mprintf("%s at [%S]", file_tail(zName), zCIUuid); | |
| 2274 | + } | |
| 2275 | + }else{ | |
| 2276 | + zHeader = mprintf("%s", file_tail(zName)); | |
| 2277 | + } | |
| 2278 | + }else if( descOnly ){ | |
| 2279 | + zHeader = mprintf("Artifact Description [%S]", zUuid); | |
| 2280 | + }else{ | |
| 2281 | + zHeader = mprintf("Artifact [%S]", zUuid); | |
| 2282 | + } | |
| 2283 | + style_header("%s", zHeader); | |
| 2284 | + fossil_free(zCIUuid); | |
| 2285 | + fossil_free(zHeader); | |
| 2261 | 2286 | if( g.perm.Admin ){ |
| 2262 | 2287 | Stmt q; |
| 2263 | 2288 | db_prepare(&q, |
| 2264 | 2289 | "SELECT coalesce(user.login,rcvfrom.uid)," |
| 2265 | 2290 | " datetime(rcvfrom.mtime,toLocal()), rcvfrom.ipaddr" |
| 2266 | 2291 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2138,21 +2138,29 @@ | |
| 2138 | const char *zLn = P("ln"); |
| 2139 | const char *zName = P("name"); |
| 2140 | const char *zCI = P("ci"); |
| 2141 | HQuery url; |
| 2142 | Blob dirname; |
| 2143 | |
| 2144 | if( zCI ){ |
| 2145 | login_check_credentials(); |
| 2146 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 2147 | |
| 2148 | blob_zero(&dirname); |
| 2149 | hyperlinked_path(zName, &dirname, zCI, "dir", ""); |
| 2150 | blob_reset(&dirname); |
| 2151 | } |
| 2152 | url_initialize(&url, g.zPath); |
| 2153 | if( isFile&&zName ) { |
| 2154 | rid = artifact_from_ci_and_filename(0, "name"); |
| 2155 | }else{ |
| 2156 | rid = artifact_from_ci_and_filename(&url, 0); |
| 2157 | } |
| 2158 | if( rid==0 ){ |
| @@ -2220,11 +2228,11 @@ | |
| 2220 | const char *zPath; |
| 2221 | Blob path; |
| 2222 | blob_zero(&path); |
| 2223 | hyperlinked_path(zName, &path, zCI, "dir", ""); |
| 2224 | zPath = blob_str(&path); |
| 2225 | @ <h2>File %s(zPath) of check-in [%z(href("/info/%!S",zCI))%S(zCI)</a>] |
| 2226 | @ </h2> |
| 2227 | blob_reset(&path); |
| 2228 | }else{ |
| 2229 | @ <h2>Latest version of file '%h(zName)':</h2> |
| 2230 | } |
| @@ -2254,12 +2262,29 @@ | |
| 2254 | g.zTop, zUuid); |
| 2255 | }else{ |
| 2256 | style_submenu_element("Shun", "%s/shun?shun=%s#addshun", g.zTop, zUuid); |
| 2257 | } |
| 2258 | } |
| 2259 | style_header("%s", isFile ? "File Content" : |
| 2260 | descOnly ? "Artifact Description" : "Artifact Content"); |
| 2261 | if( g.perm.Admin ){ |
| 2262 | Stmt q; |
| 2263 | db_prepare(&q, |
| 2264 | "SELECT coalesce(user.login,rcvfrom.uid)," |
| 2265 | " datetime(rcvfrom.mtime,toLocal()), rcvfrom.ipaddr" |
| 2266 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2138,21 +2138,29 @@ | |
| 2138 | const char *zLn = P("ln"); |
| 2139 | const char *zName = P("name"); |
| 2140 | const char *zCI = P("ci"); |
| 2141 | HQuery url; |
| 2142 | Blob dirname; |
| 2143 | char *zCIUuid = 0; |
| 2144 | int isSymbolicCI = 0; |
| 2145 | char *zHeader = 0; |
| 2146 | |
| 2147 | if( zCI && strlen(zCI)==0 ){ zCI = 0; } |
| 2148 | if( zCI ){ |
| 2149 | login_check_credentials(); |
| 2150 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 2151 | |
| 2152 | blob_zero(&dirname); |
| 2153 | hyperlinked_path(zName, &dirname, zCI, "dir", ""); |
| 2154 | blob_reset(&dirname); |
| 2155 | |
| 2156 | if( name_to_uuid2(zCI, "ci", &zCIUuid) ){ |
| 2157 | isSymbolicCI = (strncmp(zCIUuid, zCI, strlen(zCI)) != 0); |
| 2158 | } |
| 2159 | } |
| 2160 | url_initialize(&url, g.zPath); |
| 2161 | if( isFile && zName ) { |
| 2162 | rid = artifact_from_ci_and_filename(0, "name"); |
| 2163 | }else{ |
| 2164 | rid = artifact_from_ci_and_filename(&url, 0); |
| 2165 | } |
| 2166 | if( rid==0 ){ |
| @@ -2220,11 +2228,11 @@ | |
| 2228 | const char *zPath; |
| 2229 | Blob path; |
| 2230 | blob_zero(&path); |
| 2231 | hyperlinked_path(zName, &path, zCI, "dir", ""); |
| 2232 | zPath = blob_str(&path); |
| 2233 | @ <h2>File %s(zPath) of check-in [%z(href("/info/%!S",zCIUuid))%S(zCIUuid)</a>] |
| 2234 | @ </h2> |
| 2235 | blob_reset(&path); |
| 2236 | }else{ |
| 2237 | @ <h2>Latest version of file '%h(zName)':</h2> |
| 2238 | } |
| @@ -2254,12 +2262,29 @@ | |
| 2262 | g.zTop, zUuid); |
| 2263 | }else{ |
| 2264 | style_submenu_element("Shun", "%s/shun?shun=%s#addshun", g.zTop, zUuid); |
| 2265 | } |
| 2266 | } |
| 2267 | |
| 2268 | if( isFile ){ |
| 2269 | if( zCI ){ |
| 2270 | if( isSymbolicCI ){ |
| 2271 | zHeader = mprintf("%s at %s", file_tail(zName), zCI); |
| 2272 | }else{ |
| 2273 | zHeader = mprintf("%s at [%S]", file_tail(zName), zCIUuid); |
| 2274 | } |
| 2275 | }else{ |
| 2276 | zHeader = mprintf("%s", file_tail(zName)); |
| 2277 | } |
| 2278 | }else if( descOnly ){ |
| 2279 | zHeader = mprintf("Artifact Description [%S]", zUuid); |
| 2280 | }else{ |
| 2281 | zHeader = mprintf("Artifact [%S]", zUuid); |
| 2282 | } |
| 2283 | style_header("%s", zHeader); |
| 2284 | fossil_free(zCIUuid); |
| 2285 | fossil_free(zHeader); |
| 2286 | if( g.perm.Admin ){ |
| 2287 | Stmt q; |
| 2288 | db_prepare(&q, |
| 2289 | "SELECT coalesce(user.login,rcvfrom.uid)," |
| 2290 | " datetime(rcvfrom.mtime,toLocal()), rcvfrom.ipaddr" |
| 2291 |