Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | All ui pages (and JSON) should handle filenames case-sensitive because they don't access the file system. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | page-case-sensitive |
Files: | files | file ages | folders |
SHA1: |
c967b6619f60a6cc0637106c09a0b7d0 |
User & Date: | jan.nijtmans 2013-04-24 07:28:45 |
Context
2013-04-28
| ||
20:19 | All ui pages (and their JSON equivalent) should handle filenames case-sensitive because they don't access the file system ... (check-in: 4c5c96c9 user: jan.nijtmans tags: trunk) | |
2013-04-24
| ||
07:28 | All ui pages (and JSON) should handle filenames case-sensitive because they don't access the file system. ... (Closed-Leaf check-in: c967b661 user: jan.nijtmans tags: page-case-sensitive) | |
06:54 | Revert [681b17ce0e], because Chiselapp found a new home. ... (check-in: 59e4742a user: jan.nijtmans tags: trunk) | |
Changes
Changes to src/add.c.
︙ | ︙ | |||
399 400 401 402 403 404 405 | } #else caseSensitive = 1; /* Unix */ #endif caseSensitive = db_get_boolean("case-sensitive",caseSensitive); } if( !caseSensitive ){ | < | | < | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 | } #else caseSensitive = 1; /* Unix */ #endif caseSensitive = db_get_boolean("case-sensitive",caseSensitive); } if( !caseSensitive ){ db_multi_exec( "CREATE INDEX IF NOT EXISTS vfile_nocase " " ON vfile(pathname COLLATE nocase)" ); } } return caseSensitive; } /* |
︙ | ︙ |
Changes to src/browse.c.
︙ | ︙ | |||
78 79 80 81 82 83 84 | char *zSep = ""; for(i=0; zPath[i]; i=j){ for(j=i; zPath[j] && zPath[j]!='/'; j++){} if( zPath[j] && g.perm.Hyperlink ){ if( zCI ){ char *zLink = href("%R/dir?ci=%S&name=%#T", zCI, j, zPath); | | | | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | char *zSep = ""; for(i=0; zPath[i]; i=j){ for(j=i; zPath[j] && zPath[j]!='/'; j++){} if( zPath[j] && g.perm.Hyperlink ){ if( zCI ){ char *zLink = href("%R/dir?ci=%S&name=%#T", zCI, j, zPath); blob_appendf(pOut, "%s%z%#h</a>", zSep, zLink, j-i, &zPath[i]); }else{ char *zLink = href("%R/dir?name=%#T", j, zPath); blob_appendf(pOut, "%s%z%#h</a>", zSep, zLink, j-i, &zPath[i]); } }else{ blob_appendf(pOut, "%s%#h", zSep, j-i, &zPath[i]); } zSep = "/"; while( zPath[j]=='/' ){ j++; } |
︙ | ︙ | |||
144 145 146 147 148 149 150 | linkTip = rid != symbolic_name_to_rid("tip", "ci"); zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); }else{ zCI = 0; } } | | | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | linkTip = rid != symbolic_name_to_rid("tip", "ci"); zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); }else{ zCI = 0; } } /* Compute the title of the page */ blob_zero(&dirname); if( zD ){ blob_append(&dirname, "in directory ", -1); hyperlinked_path(zD, &dirname, zCI); zPrefix = mprintf("%s/", zD); if( linkTrunk ){ style_submenu_element("Trunk", "Trunk", "%R/dir?name=%t&ci=trunk", |
︙ | ︙ | |||
189 190 191 192 193 194 195 | }else{ @ <h2>The union of all files from all check-ins @ %s(blob_str(&dirname))</h2> zSubdirLink = mprintf("%R/dir?name=%T", zPrefix); } /* Compute the temporary table "localfiles" containing the names | | | < < < < < < < < | | | < | | | | | | < < < < < < < < | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | }else{ @ <h2>The union of all files from all check-ins @ %s(blob_str(&dirname))</h2> zSubdirLink = mprintf("%R/dir?name=%T", zPrefix); } /* Compute the temporary table "localfiles" containing the names ** of all files and subdirectories in the zD[] directory. ** ** Subdirectory names begin with "/". This causes them to sort ** first and it also gives us an easy way to distinguish files ** from directories in the loop that follows. */ db_multi_exec( "CREATE TEMP TABLE localfiles(x UNIQUE NOT NULL, u);" ); if( zCI ){ Stmt ins; ManifestFile *pFile; ManifestFile *pPrev = 0; int nPrev = 0; int c; db_prepare(&ins, "INSERT OR IGNORE INTO localfiles VALUES(pathelement(:x,0), :u)" ); manifest_file_rewind(pM); while( (pFile = manifest_file_next(pM,0))!=0 ){ if( nD>0 && (fossil_strncmp(pFile->zName, zD, nD-1)!=0 || pFile->zName[nD-1]!='/') ){ continue; } if( pPrev && fossil_strncmp(&pFile->zName[nD],&pPrev->zName[nD],nPrev)==0 && (pFile->zName[nD+nPrev]==0 || pFile->zName[nD+nPrev]=='/') ){ continue; } db_bind_text(&ins, ":x", &pFile->zName[nD]); db_bind_text(&ins, ":u", pFile->zUuid); db_step(&ins); db_reset(&ins); pPrev = pFile; for(nPrev=0; (c=pPrev->zName[nD+nPrev]) && c!='/'; nPrev++){} if( c=='/' ) nPrev++; } db_finalize(&ins); }else if( zD ){ db_multi_exec( "INSERT OR IGNORE INTO localfiles" " SELECT pathelement(name,%d), NULL FROM filename" " WHERE name GLOB '%q/*'", nD, zD ); }else{ db_multi_exec( "INSERT OR IGNORE INTO localfiles" " SELECT pathelement(name,0), NULL FROM filename" ); } |
︙ | ︙ | |||
349 350 351 352 353 354 355 | " pathname TEXT" ");" "CREATE INDEX fileage_fid ON fileage(fid);" ); pManifest = manifest_get(vid, CFTYPE_MANIFEST); if( pManifest==0 ) return 1; manifest_file_rewind(pManifest); | | | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | " pathname TEXT" ");" "CREATE INDEX fileage_fid ON fileage(fid);" ); pManifest = manifest_get(vid, CFTYPE_MANIFEST); if( pManifest==0 ) return 1; manifest_file_rewind(pManifest); db_prepare(&ins, "INSERT INTO temp.fileage(fid, pathname)" " SELECT rid, :path FROM blob WHERE uuid=:uuid" ); while( (pFile = manifest_file_next(pManifest, 0))!=0 ){ db_bind_text(&ins, ":uuid", pFile->zUuid); db_bind_text(&ins, ":path", pFile->zName); db_step(&ins); |
︙ | ︙ | |||
426 427 428 429 430 431 432 | style_header("File Ages", zName); compute_fileage(rid); baseTime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); zBaseTime = db_text("","SELECT datetime(%.20g,'localtime')", baseTime); @ <h2>File Ages For Check-in @ %z(href("%R/info?name=%T",zName))%h(zName)</a></h2> @ | | | | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | style_header("File Ages", zName); compute_fileage(rid); baseTime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); zBaseTime = db_text("","SELECT datetime(%.20g,'localtime')", baseTime); @ <h2>File Ages For Check-in @ %z(href("%R/info?name=%T",zName))%h(zName)</a></h2> @ @ <p>The times given are relative @ %z(href("%R/timeline?c=%T",zBaseTime))%s(zBaseTime)</a>, which is the @ check-in time for @ %z(href("%R/info?name=%T",zName))%h(zName)</a></p> @ @ <table border=0 cellspacing=0 cellpadding=0> db_prepare(&q, "SELECT mtime, (SELECT uuid FROM blob WHERE rid=fid), mid, pathname" " FROM fileage" " ORDER BY mtime DESC, mid, pathname" |
︙ | ︙ | |||
469 470 471 472 473 474 475 | @ <td>%z(href("%R/artifact/%S?ln", zFUuid))%h(db_column_text(&q, 3))</a> @ </tr> @ } @ <tr><td colspan=3><hr></tr> @ </table> db_finalize(&q); | | | 452 453 454 455 456 457 458 459 460 | @ <td>%z(href("%R/artifact/%S?ln", zFUuid))%h(db_column_text(&q, 3))</a> @ </tr> @ } @ <tr><td colspan=3><hr></tr> @ </table> db_finalize(&q); style_footer(); } |
Changes to src/finfo.c.
︙ | ︙ | |||
308 309 310 311 312 313 314 | TAG_BRANCH ); if( firstChngOnly ){ blob_appendf(&sql, ", min(event.mtime)"); } blob_appendf(&sql, " FROM mlink, event" | | | | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | TAG_BRANCH ); if( firstChngOnly ){ blob_appendf(&sql, ", min(event.mtime)"); } blob_appendf(&sql, " FROM mlink, event" " WHERE mlink.fnid IN (SELECT fnid FROM filename WHERE name=%Q)" " AND event.objid=mlink.mid", zFilename ); if( (zA = P("a"))!=0 ){ blob_appendf(&sql, " AND event.mtime>=julianday('%q')", zA); url_add_parameter(&url, "a", zA); } if( (zB = P("b"))!=0 ){ blob_appendf(&sql, " AND event.mtime<=julianday('%q')", zB); |
︙ | ︙ | |||
405 406 407 408 409 410 411 | @ %z(href("%R/artifact/%s",zUuid))[%S(zUuid)]</a> part of check-in }else{ char *zNewName; zNewName = db_text(0, "SELECT name FROM filename WHERE fnid = " " (SELECT fnid FROM mlink" " WHERE mid=%d" | | | | 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | @ %z(href("%R/artifact/%s",zUuid))[%S(zUuid)]</a> part of check-in }else{ char *zNewName; zNewName = db_text(0, "SELECT name FROM filename WHERE fnid = " " (SELECT fnid FROM mlink" " WHERE mid=%d" " AND pfnid IN (SELECT fnid FROM filename WHERE name=%Q))", fmid, zFilename); if( zNewName ){ @ <b>Renamed</b> to @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a> by check-in fossil_free(zNewName); }else{ @ <b>Deleted</b> by check-in } |
︙ | ︙ |
Changes to src/json_dir.c.
︙ | ︙ | |||
102 103 104 105 106 107 108 | nD = zD ? strlen(zD)+1 : 0; while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; } sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0, pathelementFunc, 0, 0); /* Compute the temporary table "localfiles" containing the names | | | | | < | | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | nD = zD ? strlen(zD)+1 : 0; while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; } sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0, pathelementFunc, 0, 0); /* Compute the temporary table "localfiles" containing the names ** of all files and subdirectories in the zD[] directory. ** ** Subdirectory names begin with "/". This causes them to sort ** first and it also gives us an easy way to distinguish files ** from directories in the loop that follows. */ if( zCI ){ Stmt ins; ManifestFile *pFile; ManifestFile *pPrev = 0; int nPrev = 0; int c; db_multi_exec( "CREATE TEMP TABLE json_dir_files(" " n UNIQUE NOT NULL," /* file name */ " fn UNIQUE NOT NULL," /* full file name */ " u DEFAULT NULL," /* file uuid */ " sz DEFAULT -1," /* file size */ " mtime DEFAULT NULL" /* file mtime in unix epoch format */ ");" ); db_prepare(&ins, "INSERT OR IGNORE INTO json_dir_files (n,fn,u,sz,mtime) " "SELECT" " pathelement(:path,0)," " CASE WHEN %Q IS NULL THEN '' ELSE %Q||'/' END ||:abspath," " a.uuid," " a.size," |
︙ | ︙ | |||
149 150 151 152 153 154 155 | " AND a.rid=m.fid"/*FILE artifact*/ " AND b.rid=m.mid"/*CHECKIN artifact*/ " AND a.uuid=:uuid", zD, zD ); manifest_file_rewind(pM); while( (pFile = manifest_file_next(pM,0))!=0 ){ | | | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | " AND a.rid=m.fid"/*FILE artifact*/ " AND b.rid=m.mid"/*CHECKIN artifact*/ " AND a.uuid=:uuid", zD, zD ); manifest_file_rewind(pM); while( (pFile = manifest_file_next(pM,0))!=0 ){ if( nD>0 && ((pFile->zName[nD-1]!='/') || (0!=memcmp(pFile->zName, zD, nD-1))) ){ continue; } /*printf("zD=%s, nD=%d, pFile->zName=%s\n", zD, nD, pFile->zName);*/ if( pPrev && memcmp(&pFile->zName[nD],&pPrev->zName[nD],nPrev)==0 |
︙ | ︙ | |||
172 173 174 175 176 177 178 | db_reset(&ins); pPrev = pFile; for(nPrev=0; (c=pPrev->zName[nD+nPrev]) && c!='/'; nPrev++){} if( c=='/' ) nPrev++; } db_finalize(&ins); }else if( zD && *zD ){ | < | | | | | | | | | | < < < < < < < < < < < < | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | db_reset(&ins); pPrev = pFile; for(nPrev=0; (c=pPrev->zName[nD+nPrev]) && c!='/'; nPrev++){} if( c=='/' ) nPrev++; } db_finalize(&ins); }else if( zD && *zD ){ db_multi_exec( "CREATE TEMP VIEW json_dir_files AS" " SELECT DISTINCT(pathelement(name,%d)) AS n," " %Q||'/'||name AS fn," " NULL AS u, NULL AS sz, NULL AS mtime" " FROM filename" " WHERE name GLOB '%q/*'" " GROUP BY n", nD, zD, zD ); }else{ db_multi_exec( "CREATE TEMP VIEW json_dir_files" " AS SELECT DISTINCT(pathelement(name,0)) AS n, NULL AS fn" " FROM filename" ); } |
︙ | ︙ | |||
281 282 283 284 285 286 287 | } } db_finalize(&q); if(pM){ manifest_destroy(pM); } cson_free_array( keyStore ); | | | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | } } db_finalize(&q); if(pM){ manifest_destroy(pM); } cson_free_array( keyStore ); free( zUuid ); free( zD ); return cson_object_value(zPayload); } /* ** Implements the /json/dir family of pages/commands. |
︙ | ︙ |
Changes to src/json_finfo.c.
︙ | ︙ | |||
73 74 75 76 77 78 79 | /*5*/ " coalesce(event.ecomment, event.comment)," /*6*/ " (SELECT uuid FROM blob WHERE rid=mlink.pid)," /* Parent file uuid */ /*7*/ " event.bgcolor," /*8*/ " b.size," /*9*/ " (mlink.pid==0) AS isNew," /*10*/ " (mlink.fid==0) AS isDel" " FROM mlink, blob b, event, blob ci, filename" | | | | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | /*5*/ " coalesce(event.ecomment, event.comment)," /*6*/ " (SELECT uuid FROM blob WHERE rid=mlink.pid)," /* Parent file uuid */ /*7*/ " event.bgcolor," /*8*/ " b.size," /*9*/ " (mlink.pid==0) AS isNew," /*10*/ " (mlink.fid==0) AS isDel" " FROM mlink, blob b, event, blob ci, filename" " WHERE filename.name=%Q" " AND mlink.fnid=filename.fnid" " AND b.rid=mlink.fid" " AND event.objid=mlink.mid" " AND event.objid=ci.rid", zFilename ); if( zCheckin && *zCheckin ){ char * zU = NULL; int rc = name_to_uuid2( zCheckin, "ci", &zU ); /*printf("zCheckin=[%s], zU=[%s]", zCheckin, zU);*/ if(rc<=0){ |
︙ | ︙ |