| | @@ -103,11 +103,11 @@ |
| 103 | 103 | blob_appendf(pOut, "/%h", zPath+i); |
| 104 | 104 | break; |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | if( zCI ){ |
| 108 | | - char *zLink = href("%R/%s?name=%#T%s&ci=%!S", zURI, j, zPath, zREx,zCI); |
| 108 | + char *zLink = href("%R/%s?name=%#T%s&ci=%T", zURI, j, zPath, zREx,zCI); |
| 109 | 109 | blob_appendf(pOut, "%s%z%#h</a>", |
| 110 | 110 | zSep, zLink, j-i, &zPath[i]); |
| 111 | 111 | }else{ |
| 112 | 112 | char *zLink = href("%R/%s?name=%#T%s", zURI, j, zPath, zREx); |
| 113 | 113 | blob_appendf(pOut, "%s%z%#h</a>", |
| | @@ -172,17 +172,11 @@ |
| 172 | 172 | int trunkRid = symbolic_name_to_rid("tag:trunk", "ci"); |
| 173 | 173 | linkTrunk = trunkRid && rid != trunkRid; |
| 174 | 174 | linkTip = rid != symbolic_name_to_rid("tip", "ci"); |
| 175 | 175 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 176 | 176 | isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI))!=0); |
| 177 | | - isBranchCI = db_exists( |
| 178 | | - "SELECT 1 FROM tagxref, blob" |
| 179 | | - " WHERE blob.uuid=%Q AND tagxref.rid=blob.rid" |
| 180 | | - " AND tagxref.value=%Q AND tagxref.tagtype>0" |
| 181 | | - " AND tagxref.tagid=%d", |
| 182 | | - zUuid, zCI, TAG_BRANCH |
| 183 | | - ); |
| 177 | + isBranchCI = branch_includes_uuid(zCI, zUuid); |
| 184 | 178 | }else{ |
| 185 | 179 | zCI = 0; |
| 186 | 180 | } |
| 187 | 181 | } |
| 188 | 182 | |
| | @@ -231,11 +225,11 @@ |
| 231 | 225 | }else { |
| 232 | 226 | @ of check-in %z(href("%R/info?name=%T",zCI))%h(zCI)</a></h2> |
| 233 | 227 | } |
| 234 | 228 | zSubdirLink = mprintf("%R/dir?ci=%T&name=%T", zCI, zPrefix); |
| 235 | 229 | if( nD==0 ){ |
| 236 | | - style_submenu_element("File Ages", "%R/fileage?name=%!S", zUuid); |
| 230 | + style_submenu_element("File Ages", "%R/fileage?name=%T", zCI); |
| 237 | 231 | } |
| 238 | 232 | }else{ |
| 239 | 233 | @ in any check-in</h2> |
| 240 | 234 | zSubdirLink = mprintf("%R/dir?name=%T", zPrefix); |
| 241 | 235 | } |
| | @@ -326,11 +320,11 @@ |
| 326 | 320 | zFN++; |
| 327 | 321 | @ <li class="dir">%z(href("%s%T",zSubdirLink,zFN))%h(zFN)</a></li> |
| 328 | 322 | }else{ |
| 329 | 323 | const char *zLink; |
| 330 | 324 | if( zCI ){ |
| 331 | | - zLink = href("%R/file?name=%T%T&ci=%!S",zPrefix,zFN,zCI); |
| 325 | + zLink = href("%R/file?name=%T%T&ci=%T",zPrefix,zFN,zCI); |
| 332 | 326 | }else{ |
| 333 | 327 | zLink = href("%R/finfo?name=%T%T",zPrefix,zFN); |
| 334 | 328 | } |
| 335 | 329 | @ <li class="%z(fileext_class(zFN))">%z(zLink)%h(zFN)</a></li> |
| 336 | 330 | } |
| | @@ -656,10 +650,11 @@ |
| 656 | 650 | int startExpanded; /* True to start out with the tree expanded */ |
| 657 | 651 | int showDirOnly; /* Show directories only. Omit files */ |
| 658 | 652 | int nDir = 0; /* Number of directories. Used for ID attributes */ |
| 659 | 653 | char *zProjectName = db_get("project-name", 0); |
| 660 | 654 | int isSymbolicCI = 0; /* ci= is a symbolic name, not a hash prefix */ |
| 655 | + int isBranchCI = 0; /* ci= refers to a branch name */ |
| 661 | 656 | char *zHeader = 0; |
| 662 | 657 | |
| 663 | 658 | if( zCI && strlen(zCI)==0 ){ zCI = 0; } |
| 664 | 659 | if( strcmp(PD("type","flat"),"flat")==0 ){ page_dir(); return; } |
| 665 | 660 | memset(&sTree, 0, sizeof(sTree)); |
| | @@ -705,10 +700,11 @@ |
| 705 | 700 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 706 | 701 | rNow = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); |
| 707 | 702 | zNow = db_text("", "SELECT datetime(mtime,toLocal())" |
| 708 | 703 | " FROM event WHERE objid=%d", rid); |
| 709 | 704 | isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI)) != 0); |
| 705 | + isBranchCI = branch_includes_uuid(zCI, zUuid); |
| 710 | 706 | }else{ |
| 711 | 707 | zCI = 0; |
| 712 | 708 | } |
| 713 | 709 | } |
| 714 | 710 | if( zCI==0 ){ |
| | @@ -715,19 +711,22 @@ |
| 715 | 711 | rNow = db_double(0.0, "SELECT max(mtime) FROM event"); |
| 716 | 712 | zNow = db_text("", "SELECT datetime(max(mtime),toLocal()) FROM event"); |
| 717 | 713 | } |
| 718 | 714 | |
| 719 | 715 | assert( isSymbolicCI==0 || (zCI!=0 && zCI[0]!=0) ); |
| 720 | | - if( isSymbolicCI ) { |
| 721 | | - zHeader = mprintf("%s at %s", |
| 722 | | - (zD ? zD : (showDirOnly ? "Folder Hierarchy" : "Tree-View")), zCI); |
| 723 | | - }else if( zUuid && strlen(zUuid) ){ |
| 724 | | - zHeader = mprintf("%s at [%S]", |
| 725 | | - (zD ? zD : (showDirOnly ? "Folder Hierarchy" : "Tree-View")), zUuid); |
| 716 | + if( zD==0 ){ |
| 717 | + if( zCI ){ |
| 718 | + zHeader = mprintf("Top-level Files of %s", zCI); |
| 719 | + }else{ |
| 720 | + zHeader = mprintf("All Top-level Files"); |
| 721 | + } |
| 726 | 722 | }else{ |
| 727 | | - zHeader = mprintf("%s", |
| 728 | | - (zD ? zD : (showDirOnly ?"All Folders Hierarchy":"All Files Tree-View"))); |
| 723 | + if( zCI ){ |
| 724 | + zHeader = mprintf("Files in %s/ of %s", zD, zCI); |
| 725 | + }else{ |
| 726 | + zHeader = mprintf("All File in %s/", zD); |
| 727 | + } |
| 729 | 728 | } |
| 730 | 729 | style_header("%s", zHeader); |
| 731 | 730 | fossil_free(zHeader); |
| 732 | 731 | |
| 733 | 732 | /* Compute the title of the page */ |
| | @@ -736,20 +735,18 @@ |
| 736 | 735 | blob_append(&dirname, "within directory ", -1); |
| 737 | 736 | hyperlinked_path(zD, &dirname, zCI, "tree", zREx, 0); |
| 738 | 737 | if( zRE ) blob_appendf(&dirname, " matching \"%s\"", zRE); |
| 739 | 738 | style_submenu_element("Top-Level", "%s", |
| 740 | 739 | url_render(&sURI, "name", 0, 0, 0)); |
| 741 | | - }else{ |
| 742 | | - if( zRE ){ |
| 743 | | - blob_appendf(&dirname, "matching \"%s\"", zRE); |
| 744 | | - } |
| 740 | + }else if( zRE ){ |
| 741 | + blob_appendf(&dirname, "matching \"%s\"", zRE); |
| 745 | 742 | } |
| 746 | 743 | style_submenu_binary("mtime","Sort By Time","Sort By Filename", 0); |
| 747 | 744 | if( zCI ){ |
| 748 | 745 | style_submenu_element("All", "%s", url_render(&sURI, "ci", 0, 0, 0)); |
| 749 | 746 | if( nD==0 && !showDirOnly ){ |
| 750 | | - style_submenu_element("File Ages", "%R/fileage?name=%s", zUuid); |
| 747 | + style_submenu_element("File Ages", "%R/fileage?name=%T", zCI); |
| 751 | 748 | } |
| 752 | 749 | } |
| 753 | 750 | if( linkTrunk ){ |
| 754 | 751 | style_submenu_element("Trunk", "%s", |
| 755 | 752 | url_render(&sURI, "ci", "trunk", 0, 0)); |
| | @@ -804,10 +801,11 @@ |
| 804 | 801 | tree_add_node(&sTree, zName, zUuid, mtime); |
| 805 | 802 | nFile++; |
| 806 | 803 | } |
| 807 | 804 | db_finalize(&q); |
| 808 | 805 | } |
| 806 | + style_submenu_checkbox("nofiles", "Folders Only", 0, 0); |
| 809 | 807 | |
| 810 | 808 | if( showDirOnly ){ |
| 811 | 809 | for(nFile=0, p=sTree.pFirst; p; p=p->pNext){ |
| 812 | 810 | if( p->pChild!=0 && p->nFullName>nD ) nFile++; |
| 813 | 811 | } |
| | @@ -814,18 +812,24 @@ |
| 814 | 812 | zObjType = "Folders"; |
| 815 | 813 | }else{ |
| 816 | 814 | zObjType = "Files"; |
| 817 | 815 | } |
| 818 | 816 | |
| 819 | | - style_submenu_checkbox("nofiles", "Folders Only", 0, 0); |
| 820 | | - |
| 821 | | - if( zCI ){ |
| 822 | | - @ <h2>%s(zObjType) at check-in |
| 823 | | - if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){ |
| 824 | | - @ "%h(zCI)" |
| 825 | | - } |
| 826 | | - @ [%z(href("vinfo?name=%!S",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname)) |
| 817 | + if( zCI && strcmp(zCI,"tip")==0 ){ |
| 818 | + @ <h2>%s(zObjType) in the %z(href("%R/info?name=tip"))latest check-in</a> |
| 819 | + }else if( isBranchCI ){ |
| 820 | + @ <h2>%s(zObjType) in the %z(href("%R/info?name=%T",zCI))latest check-in\ |
| 821 | + @ </a> for branch %z(href("%R/timeline?r=%T",zCI))%h(zCI)</a> |
| 822 | + if( blob_size(&dirname) ){ |
| 823 | + @ and %s(blob_str(&dirname))</h2> |
| 824 | + } |
| 825 | + }else if( zCI ){ |
| 826 | + @ <h2>%s(zObjType) for check-in \ |
| 827 | + @ %z(href("%R/info?name=%T",zCI))%h(zCI)</a></h2> |
| 828 | + if( blob_size(&dirname) ){ |
| 829 | + @ and %s(blob_str(&dirname))</h2> |
| 830 | + } |
| 827 | 831 | }else{ |
| 828 | 832 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 829 | 833 | @ <h2>%s(zObjType) from all %d(n) check-ins %s(blob_str(&dirname)) |
| 830 | 834 | } |
| 831 | 835 | if( useMtime ){ |
| | @@ -883,11 +887,11 @@ |
| 883 | 887 | nDir++; |
| 884 | 888 | }else if( !showDirOnly ){ |
| 885 | 889 | const char *zFileClass = fileext_class(p->zName); |
| 886 | 890 | char *zLink; |
| 887 | 891 | if( zCI ){ |
| 888 | | - zLink = href("%R/file?name=%T&ci=%!S",p->zFullName,zCI); |
| 892 | + zLink = href("%R/file?name=%T&ci=%T",p->zFullName,zCI); |
| 889 | 893 | }else{ |
| 890 | 894 | zLink = href("%R/finfo?name=%T",p->zFullName); |
| 891 | 895 | } |
| 892 | 896 | @ <li class="%z(zFileClass)%s(zLastClass)"><div class="filetreeline"> |
| 893 | 897 | @ %z(zLink)%h(p->zName)</a> |
| | @@ -1060,10 +1064,11 @@ |
| 1060 | 1064 | int rid; |
| 1061 | 1065 | const char *zName; |
| 1062 | 1066 | const char *zGlob; |
| 1063 | 1067 | const char *zUuid; |
| 1064 | 1068 | const char *zNow; /* Time of check-in */ |
| 1069 | + int isBranchCI; /* name= is a branch name */ |
| 1065 | 1070 | int showId = PB("showid"); |
| 1066 | 1071 | Stmt q1, q2; |
| 1067 | 1072 | double baseTime; |
| 1068 | 1073 | login_check_credentials(); |
| 1069 | 1074 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| | @@ -1073,28 +1078,34 @@ |
| 1073 | 1078 | rid = symbolic_name_to_rid(zName, "ci"); |
| 1074 | 1079 | if( rid==0 ){ |
| 1075 | 1080 | fossil_fatal("not a valid check-in: %s", zName); |
| 1076 | 1081 | } |
| 1077 | 1082 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1083 | + isBranchCI = branch_includes_uuid(zName,zUuid); |
| 1078 | 1084 | baseTime = db_double(0.0,"SELECT mtime FROM event WHERE objid=%d", rid); |
| 1079 | 1085 | zNow = db_text("", "SELECT datetime(mtime,toLocal()) FROM event" |
| 1080 | 1086 | " WHERE objid=%d", rid); |
| 1081 | 1087 | style_submenu_element("Tree-View", "%R/tree?ci=%T&mtime=1&type=tree", zName); |
| 1082 | 1088 | style_header("File Ages"); |
| 1083 | 1089 | zGlob = P("glob"); |
| 1084 | 1090 | compute_fileage(rid,zGlob); |
| 1085 | 1091 | db_multi_exec("CREATE INDEX fileage_ix1 ON fileage(mid,pathname);"); |
| 1086 | 1092 | |
| 1087 | | - @ <h1>Files in |
| 1088 | | - @ %z(href("%R/info/%!S",zUuid))[%S(zUuid)]</a> |
| 1093 | + if( fossil_strcmp(zName,"tip")==0 ){ |
| 1094 | + @ <h1>Files in the %z(href("%R/info?name=tip"))latest check-in</a> |
| 1095 | + }else if( isBranchCI ){ |
| 1096 | + @ <h1>Files in the %z(href("%R/info?name=%T",zName))latest check-in</a> |
| 1097 | + @ of branch %z(href("%R/timeline?r=%T",zName))%h(zName)</a> |
| 1098 | + }else{ |
| 1099 | + @ <h1>Files in check-in %z(href("%R/info?name=%T",zName))%h(zName)</a> |
| 1100 | + } |
| 1089 | 1101 | if( zGlob && zGlob[0] ){ |
| 1090 | 1102 | @ that match "%h(zGlob)" |
| 1091 | 1103 | } |
| 1092 | 1104 | @ ordered by age</h1> |
| 1093 | 1105 | @ |
| 1094 | | - @ <p>File ages are expressed relative to the |
| 1095 | | - @ %z(href("%R/ci/%!S",zUuid))[%S(zUuid)]</a> check-in time of |
| 1106 | + @ <p>File ages are expressed relative to the check-in time of |
| 1096 | 1107 | @ %z(href("%R/timeline?c=%t",zNow))%s(zNow)</a>.</p> |
| 1097 | 1108 | @ |
| 1098 | 1109 | @ <div class='fileage'><table> |
| 1099 | 1110 | @ <tr><th>Age</th><th>Files</th><th>Check-in</th></tr> |
| 1100 | 1111 | db_prepare(&q1, |
| | @@ -1109,14 +1120,13 @@ |
| 1109 | 1120 | " AND blob.rid=event.objid\n" |
| 1110 | 1121 | " ORDER BY event.mtime DESC;", |
| 1111 | 1122 | TAG_BRANCH |
| 1112 | 1123 | ); |
| 1113 | 1124 | db_prepare(&q2, |
| 1114 | | - "SELECT blob.uuid, filename.name, fileage.fid\n" |
| 1115 | | - " FROM fileage, blob, filename\n" |
| 1125 | + "SELECT filename.name, fileage.fid\n" |
| 1126 | + " FROM fileage, filename\n" |
| 1116 | 1127 | " WHERE fileage.mid=:mid AND filename.fnid=fileage.fnid" |
| 1117 | | - " AND blob.rid=fileage.fid;" |
| 1118 | 1128 | ); |
| 1119 | 1129 | while( db_step(&q1)==SQLITE_ROW ){ |
| 1120 | 1130 | double age = baseTime - db_column_double(&q1, 0); |
| 1121 | 1131 | int mid = db_column_int(&q1, 1); |
| 1122 | 1132 | const char *zUuid = db_column_text(&q1, 2); |
| | @@ -1126,24 +1136,24 @@ |
| 1126 | 1136 | char *zAge = human_readable_age(age); |
| 1127 | 1137 | @ <tr><td>%s(zAge)</td> |
| 1128 | 1138 | @ <td> |
| 1129 | 1139 | db_bind_int(&q2, ":mid", mid); |
| 1130 | 1140 | while( db_step(&q2)==SQLITE_ROW ){ |
| 1131 | | - const char *zFUuid = db_column_text(&q2,0); |
| 1132 | | - const char *zFile = db_column_text(&q2,1); |
| 1133 | | - int fid = db_column_int(&q2,2); |
| 1141 | + const char *zFile = db_column_text(&q2,0); |
| 1142 | + @ %z(href("%R/file?name=%T&ci=%!S",zFile,zUuid))%h(zFile)</a> \ |
| 1134 | 1143 | if( showId ){ |
| 1135 | | - @ %z(href("%R/artifact/%!S",zFUuid))%h(zFile)</a> (%d(fid))<br /> |
| 1144 | + int fid = db_column_int(&q2,1); |
| 1145 | + @ (%d(fid))<br /> |
| 1136 | 1146 | }else{ |
| 1137 | | - @ %z(href("%R/artifact/%!S",zFUuid))%h(zFile)</a><br /> |
| 1147 | + @ </a><br /> |
| 1138 | 1148 | } |
| 1139 | 1149 | } |
| 1140 | 1150 | db_reset(&q2); |
| 1141 | 1151 | @ </td> |
| 1142 | 1152 | @ <td> |
| 1143 | 1153 | @ %W(zComment) |
| 1144 | | - @ (check-in: %z(href("%R/ci/%!S",zUuid))%S(zUuid)</a>, |
| 1154 | + @ (check-in: %z(href("%R/info/%!S",zUuid))%S(zUuid)</a>, |
| 1145 | 1155 | if( showId ){ |
| 1146 | 1156 | @ id: %d(mid) |
| 1147 | 1157 | } |
| 1148 | 1158 | @ user: %z(href("%R/timeline?u=%t&c=%!S&nd",zUser,zUuid))%h(zUser)</a>, |
| 1149 | 1159 | @ branch: \ |
| 1150 | 1160 | |