Fossil SCM
Wiki test fixes.
Commit
b40f1ac135038a0b410d21a882aa1dd78fd831bd201fc38561b4c7cc5296c6ae
Parent
3ad81c3c499599b…
5 files changed
+7
-2
+7
-2
+1
-1
+11
+10
-10
+7
-2
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -192,10 +192,11 @@ | ||
| 192 | 192 | int i; |
| 193 | 193 | int startOfBranch = 0; |
| 194 | 194 | const char *zXTag; /* zTag with optional [...] removed */ |
| 195 | 195 | int nXTag; /* Size of zXTag */ |
| 196 | 196 | const char *zDate; /* Expanded date-time string */ |
| 197 | + const char *zTagPrefix = "sym"; | |
| 197 | 198 | |
| 198 | 199 | if( zType==0 || zType[0]==0 ){ |
| 199 | 200 | zType = "*"; |
| 200 | 201 | }else if( zType[0]=='b' ){ |
| 201 | 202 | zType = "ci"; |
| @@ -354,20 +355,24 @@ | ||
| 354 | 355 | } |
| 355 | 356 | db_finalize(&q); |
| 356 | 357 | if( rid ) return rid; |
| 357 | 358 | } |
| 358 | 359 | |
| 360 | + if( zType[0]=='w' ){ | |
| 361 | + zTagPrefix = "wiki"; | |
| 362 | + } | |
| 359 | 363 | /* Symbolic name */ |
| 360 | 364 | rid = db_int(0, |
| 361 | 365 | "SELECT event.objid, max(event.mtime)" |
| 362 | 366 | " FROM tag, tagxref, event" |
| 363 | - " WHERE tag.tagname='sym-%q' " | |
| 367 | + " WHERE tag.tagname='%q-%q' " | |
| 364 | 368 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 365 | 369 | " AND event.objid=tagxref.rid " |
| 366 | 370 | " AND event.type GLOB '%q'", |
| 367 | - zTag, zType | |
| 371 | + zTagPrefix, zTag, zType | |
| 368 | 372 | ); |
| 373 | + | |
| 369 | 374 | if( rid>0 ){ |
| 370 | 375 | if( startOfBranch ) rid = start_of_branch(rid,1); |
| 371 | 376 | return rid; |
| 372 | 377 | } |
| 373 | 378 | |
| 374 | 379 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -192,10 +192,11 @@ | |
| 192 | int i; |
| 193 | int startOfBranch = 0; |
| 194 | const char *zXTag; /* zTag with optional [...] removed */ |
| 195 | int nXTag; /* Size of zXTag */ |
| 196 | const char *zDate; /* Expanded date-time string */ |
| 197 | |
| 198 | if( zType==0 || zType[0]==0 ){ |
| 199 | zType = "*"; |
| 200 | }else if( zType[0]=='b' ){ |
| 201 | zType = "ci"; |
| @@ -354,20 +355,24 @@ | |
| 354 | } |
| 355 | db_finalize(&q); |
| 356 | if( rid ) return rid; |
| 357 | } |
| 358 | |
| 359 | /* Symbolic name */ |
| 360 | rid = db_int(0, |
| 361 | "SELECT event.objid, max(event.mtime)" |
| 362 | " FROM tag, tagxref, event" |
| 363 | " WHERE tag.tagname='sym-%q' " |
| 364 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 365 | " AND event.objid=tagxref.rid " |
| 366 | " AND event.type GLOB '%q'", |
| 367 | zTag, zType |
| 368 | ); |
| 369 | if( rid>0 ){ |
| 370 | if( startOfBranch ) rid = start_of_branch(rid,1); |
| 371 | return rid; |
| 372 | } |
| 373 | |
| 374 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -192,10 +192,11 @@ | |
| 192 | int i; |
| 193 | int startOfBranch = 0; |
| 194 | const char *zXTag; /* zTag with optional [...] removed */ |
| 195 | int nXTag; /* Size of zXTag */ |
| 196 | const char *zDate; /* Expanded date-time string */ |
| 197 | const char *zTagPrefix = "sym"; |
| 198 | |
| 199 | if( zType==0 || zType[0]==0 ){ |
| 200 | zType = "*"; |
| 201 | }else if( zType[0]=='b' ){ |
| 202 | zType = "ci"; |
| @@ -354,20 +355,24 @@ | |
| 355 | } |
| 356 | db_finalize(&q); |
| 357 | if( rid ) return rid; |
| 358 | } |
| 359 | |
| 360 | if( zType[0]=='w' ){ |
| 361 | zTagPrefix = "wiki"; |
| 362 | } |
| 363 | /* Symbolic name */ |
| 364 | rid = db_int(0, |
| 365 | "SELECT event.objid, max(event.mtime)" |
| 366 | " FROM tag, tagxref, event" |
| 367 | " WHERE tag.tagname='%q-%q' " |
| 368 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 369 | " AND event.objid=tagxref.rid " |
| 370 | " AND event.type GLOB '%q'", |
| 371 | zTagPrefix, zTag, zType |
| 372 | ); |
| 373 | |
| 374 | if( rid>0 ){ |
| 375 | if( startOfBranch ) rid = start_of_branch(rid,1); |
| 376 | return rid; |
| 377 | } |
| 378 | |
| 379 |
+7
-2
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -192,10 +192,11 @@ | ||
| 192 | 192 | int i; |
| 193 | 193 | int startOfBranch = 0; |
| 194 | 194 | const char *zXTag; /* zTag with optional [...] removed */ |
| 195 | 195 | int nXTag; /* Size of zXTag */ |
| 196 | 196 | const char *zDate; /* Expanded date-time string */ |
| 197 | + const char *zTagPrefix = "sym"; | |
| 197 | 198 | |
| 198 | 199 | if( zType==0 || zType[0]==0 ){ |
| 199 | 200 | zType = "*"; |
| 200 | 201 | }else if( zType[0]=='b' ){ |
| 201 | 202 | zType = "ci"; |
| @@ -354,20 +355,24 @@ | ||
| 354 | 355 | } |
| 355 | 356 | db_finalize(&q); |
| 356 | 357 | if( rid ) return rid; |
| 357 | 358 | } |
| 358 | 359 | |
| 360 | + if( zType[0]=='w' ){ | |
| 361 | + zTagPrefix = "wiki"; | |
| 362 | + } | |
| 359 | 363 | /* Symbolic name */ |
| 360 | 364 | rid = db_int(0, |
| 361 | 365 | "SELECT event.objid, max(event.mtime)" |
| 362 | 366 | " FROM tag, tagxref, event" |
| 363 | - " WHERE tag.tagname='sym-%q' " | |
| 367 | + " WHERE tag.tagname='%q-%q' " | |
| 364 | 368 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 365 | 369 | " AND event.objid=tagxref.rid " |
| 366 | 370 | " AND event.type GLOB '%q'", |
| 367 | - zTag, zType | |
| 371 | + zTagPrefix, zTag, zType | |
| 368 | 372 | ); |
| 373 | + | |
| 369 | 374 | if( rid>0 ){ |
| 370 | 375 | if( startOfBranch ) rid = start_of_branch(rid,1); |
| 371 | 376 | return rid; |
| 372 | 377 | } |
| 373 | 378 | |
| 374 | 379 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -192,10 +192,11 @@ | |
| 192 | int i; |
| 193 | int startOfBranch = 0; |
| 194 | const char *zXTag; /* zTag with optional [...] removed */ |
| 195 | int nXTag; /* Size of zXTag */ |
| 196 | const char *zDate; /* Expanded date-time string */ |
| 197 | |
| 198 | if( zType==0 || zType[0]==0 ){ |
| 199 | zType = "*"; |
| 200 | }else if( zType[0]=='b' ){ |
| 201 | zType = "ci"; |
| @@ -354,20 +355,24 @@ | |
| 354 | } |
| 355 | db_finalize(&q); |
| 356 | if( rid ) return rid; |
| 357 | } |
| 358 | |
| 359 | /* Symbolic name */ |
| 360 | rid = db_int(0, |
| 361 | "SELECT event.objid, max(event.mtime)" |
| 362 | " FROM tag, tagxref, event" |
| 363 | " WHERE tag.tagname='sym-%q' " |
| 364 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 365 | " AND event.objid=tagxref.rid " |
| 366 | " AND event.type GLOB '%q'", |
| 367 | zTag, zType |
| 368 | ); |
| 369 | if( rid>0 ){ |
| 370 | if( startOfBranch ) rid = start_of_branch(rid,1); |
| 371 | return rid; |
| 372 | } |
| 373 | |
| 374 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -192,10 +192,11 @@ | |
| 192 | int i; |
| 193 | int startOfBranch = 0; |
| 194 | const char *zXTag; /* zTag with optional [...] removed */ |
| 195 | int nXTag; /* Size of zXTag */ |
| 196 | const char *zDate; /* Expanded date-time string */ |
| 197 | const char *zTagPrefix = "sym"; |
| 198 | |
| 199 | if( zType==0 || zType[0]==0 ){ |
| 200 | zType = "*"; |
| 201 | }else if( zType[0]=='b' ){ |
| 202 | zType = "ci"; |
| @@ -354,20 +355,24 @@ | |
| 355 | } |
| 356 | db_finalize(&q); |
| 357 | if( rid ) return rid; |
| 358 | } |
| 359 | |
| 360 | if( zType[0]=='w' ){ |
| 361 | zTagPrefix = "wiki"; |
| 362 | } |
| 363 | /* Symbolic name */ |
| 364 | rid = db_int(0, |
| 365 | "SELECT event.objid, max(event.mtime)" |
| 366 | " FROM tag, tagxref, event" |
| 367 | " WHERE tag.tagname='%q-%q' " |
| 368 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 369 | " AND event.objid=tagxref.rid " |
| 370 | " AND event.type GLOB '%q'", |
| 371 | zTagPrefix, zTag, zType |
| 372 | ); |
| 373 | |
| 374 | if( rid>0 ){ |
| 375 | if( startOfBranch ) rid = start_of_branch(rid,1); |
| 376 | return rid; |
| 377 | } |
| 378 | |
| 379 |
+1
-1
| --- test/settings.test | ||
| +++ test/settings.test | ||
| @@ -39,11 +39,11 @@ | ||
| 39 | 39 | # |
| 40 | 40 | proc extract_setting_names { data } { |
| 41 | 41 | set names [list] |
| 42 | 42 | |
| 43 | 43 | foreach {dummy name} [regexp \ |
| 44 | - -all -line -inline -- {^([a-z][a-z0-9\-]*) } $data] { | |
| 44 | + -all -line -inline -- {^([a-z][a-z0-9\-]*) ?.*$} $data] { | |
| 45 | 45 | lappend names $name |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | return $names |
| 49 | 49 | } |
| 50 | 50 |
| --- test/settings.test | |
| +++ test/settings.test | |
| @@ -39,11 +39,11 @@ | |
| 39 | # |
| 40 | proc extract_setting_names { data } { |
| 41 | set names [list] |
| 42 | |
| 43 | foreach {dummy name} [regexp \ |
| 44 | -all -line -inline -- {^([a-z][a-z0-9\-]*) } $data] { |
| 45 | lappend names $name |
| 46 | } |
| 47 | |
| 48 | return $names |
| 49 | } |
| 50 |
| --- test/settings.test | |
| +++ test/settings.test | |
| @@ -39,11 +39,11 @@ | |
| 39 | # |
| 40 | proc extract_setting_names { data } { |
| 41 | set names [list] |
| 42 | |
| 43 | foreach {dummy name} [regexp \ |
| 44 | -all -line -inline -- {^([a-z][a-z0-9\-]*) ?.*$} $data] { |
| 45 | lappend names $name |
| 46 | } |
| 47 | |
| 48 | return $names |
| 49 | } |
| 50 |
+11
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -272,22 +272,32 @@ | ||
| 272 | 272 | auto-captcha \ |
| 273 | 273 | auto-hyperlink \ |
| 274 | 274 | auto-shun \ |
| 275 | 275 | autosync \ |
| 276 | 276 | autosync-tries \ |
| 277 | + backoffice-disable \ | |
| 278 | + backoffice-logfile \ | |
| 279 | + backoffice-nodelay \ | |
| 277 | 280 | binary-glob \ |
| 278 | 281 | case-sensitive \ |
| 279 | 282 | clean-glob \ |
| 280 | 283 | clearsign \ |
| 284 | + comment-format \ | |
| 281 | 285 | crlf-glob \ |
| 282 | 286 | crnl-glob \ |
| 283 | 287 | default-perms \ |
| 284 | 288 | diff-binary \ |
| 285 | 289 | diff-command \ |
| 286 | 290 | dont-push \ |
| 287 | 291 | dotfiles \ |
| 288 | 292 | editor \ |
| 293 | + email-self \ | |
| 294 | + email-send-command \ | |
| 295 | + email-send-db \ | |
| 296 | + email-send-dir \ | |
| 297 | + email-send-method \ | |
| 298 | + email-send-relayhost \ | |
| 289 | 299 | empty-dirs \ |
| 290 | 300 | encoding-glob \ |
| 291 | 301 | exec-rel-paths \ |
| 292 | 302 | gdiff-command \ |
| 293 | 303 | gmerge-command \ |
| @@ -308,10 +318,11 @@ | ||
| 308 | 318 | repo-cksum \ |
| 309 | 319 | self-register \ |
| 310 | 320 | ssh-command \ |
| 311 | 321 | ssl-ca-location \ |
| 312 | 322 | ssl-identity \ |
| 323 | + tclsh \ | |
| 313 | 324 | th1-setup \ |
| 314 | 325 | th1-uri-regexp \ |
| 315 | 326 | uv-sync \ |
| 316 | 327 | web-browser] |
| 317 | 328 | |
| 318 | 329 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -272,22 +272,32 @@ | |
| 272 | auto-captcha \ |
| 273 | auto-hyperlink \ |
| 274 | auto-shun \ |
| 275 | autosync \ |
| 276 | autosync-tries \ |
| 277 | binary-glob \ |
| 278 | case-sensitive \ |
| 279 | clean-glob \ |
| 280 | clearsign \ |
| 281 | crlf-glob \ |
| 282 | crnl-glob \ |
| 283 | default-perms \ |
| 284 | diff-binary \ |
| 285 | diff-command \ |
| 286 | dont-push \ |
| 287 | dotfiles \ |
| 288 | editor \ |
| 289 | empty-dirs \ |
| 290 | encoding-glob \ |
| 291 | exec-rel-paths \ |
| 292 | gdiff-command \ |
| 293 | gmerge-command \ |
| @@ -308,10 +318,11 @@ | |
| 308 | repo-cksum \ |
| 309 | self-register \ |
| 310 | ssh-command \ |
| 311 | ssl-ca-location \ |
| 312 | ssl-identity \ |
| 313 | th1-setup \ |
| 314 | th1-uri-regexp \ |
| 315 | uv-sync \ |
| 316 | web-browser] |
| 317 | |
| 318 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -272,22 +272,32 @@ | |
| 272 | auto-captcha \ |
| 273 | auto-hyperlink \ |
| 274 | auto-shun \ |
| 275 | autosync \ |
| 276 | autosync-tries \ |
| 277 | backoffice-disable \ |
| 278 | backoffice-logfile \ |
| 279 | backoffice-nodelay \ |
| 280 | binary-glob \ |
| 281 | case-sensitive \ |
| 282 | clean-glob \ |
| 283 | clearsign \ |
| 284 | comment-format \ |
| 285 | crlf-glob \ |
| 286 | crnl-glob \ |
| 287 | default-perms \ |
| 288 | diff-binary \ |
| 289 | diff-command \ |
| 290 | dont-push \ |
| 291 | dotfiles \ |
| 292 | editor \ |
| 293 | email-self \ |
| 294 | email-send-command \ |
| 295 | email-send-db \ |
| 296 | email-send-dir \ |
| 297 | email-send-method \ |
| 298 | email-send-relayhost \ |
| 299 | empty-dirs \ |
| 300 | encoding-glob \ |
| 301 | exec-rel-paths \ |
| 302 | gdiff-command \ |
| 303 | gmerge-command \ |
| @@ -308,10 +318,11 @@ | |
| 318 | repo-cksum \ |
| 319 | self-register \ |
| 320 | ssh-command \ |
| 321 | ssl-ca-location \ |
| 322 | ssl-identity \ |
| 323 | tclsh \ |
| 324 | th1-setup \ |
| 325 | th1-uri-regexp \ |
| 326 | uv-sync \ |
| 327 | web-browser] |
| 328 | |
| 329 |
+10
-10
| --- test/wiki.test | ||
| +++ test/wiki.test | ||
| @@ -45,25 +45,25 @@ | ||
| 45 | 45 | # Note: Makes fossil calls, so $CODE and $RESULT will be corrupted |
| 46 | 46 | proc get_mime_type {name} { |
| 47 | 47 | global CODE RESULT |
| 48 | 48 | fossil http << "GET /wiki?name=$name" |
| 49 | 49 | if {$CODE != 0} { |
| 50 | - return error: /wiki?name=$name $CODE $RESULT" | |
| 50 | + return "error: /wiki?name=$name $CODE $RESULT" | |
| 51 | + } | |
| 52 | + fossil whatis --type w $name | |
| 53 | + if {$CODE != 0} { | |
| 54 | + return "error: fossil whatis --type w $name $CODE $RESULT" | |
| 51 | 55 | } |
| 52 | - set CODE [regexp {href="/info/([0-9a-f]+)"} $RESULT match info] | |
| 56 | + set CODE [regexp -line {^artifact:\s*([0-9a-f]+)$} $RESULT match info] | |
| 53 | 57 | if {$CODE == 0} { |
| 54 | - return "error: No info link found for wiki page $name" | |
| 58 | + return "error: whatis returned no info for wiki page $name" | |
| 55 | 59 | } |
| 56 | - fossil http << "GET /artifact/$info" | |
| 60 | + fossil artifact $info | |
| 57 | 61 | if {$CODE != 0} { |
| 58 | - return "error: /artifact/$info $CODE $RESULT" | |
| 62 | + return "error: fossil artifact $info $CODE $RESULT" | |
| 59 | 63 | } |
| 60 | - set CODE [regexp {<pre>(.*)</pre>} $RESULT match pre] | |
| 61 | - if {$CODE == 0} { | |
| 62 | - return "error: No pre block in /artifact/$info" | |
| 63 | - } | |
| 64 | - set CODE [regexp -line {^N (.*)$} $pre match mimetype] | |
| 64 | + set CODE [regexp -line {^N (.*)$} $RESULT match mimetype] | |
| 65 | 65 | if {$CODE == 0} { |
| 66 | 66 | return "text/x-fossil-wiki" |
| 67 | 67 | } |
| 68 | 68 | return $mimetype |
| 69 | 69 | } |
| 70 | 70 |
| --- test/wiki.test | |
| +++ test/wiki.test | |
| @@ -45,25 +45,25 @@ | |
| 45 | # Note: Makes fossil calls, so $CODE and $RESULT will be corrupted |
| 46 | proc get_mime_type {name} { |
| 47 | global CODE RESULT |
| 48 | fossil http << "GET /wiki?name=$name" |
| 49 | if {$CODE != 0} { |
| 50 | return error: /wiki?name=$name $CODE $RESULT" |
| 51 | } |
| 52 | set CODE [regexp {href="/info/([0-9a-f]+)"} $RESULT match info] |
| 53 | if {$CODE == 0} { |
| 54 | return "error: No info link found for wiki page $name" |
| 55 | } |
| 56 | fossil http << "GET /artifact/$info" |
| 57 | if {$CODE != 0} { |
| 58 | return "error: /artifact/$info $CODE $RESULT" |
| 59 | } |
| 60 | set CODE [regexp {<pre>(.*)</pre>} $RESULT match pre] |
| 61 | if {$CODE == 0} { |
| 62 | return "error: No pre block in /artifact/$info" |
| 63 | } |
| 64 | set CODE [regexp -line {^N (.*)$} $pre match mimetype] |
| 65 | if {$CODE == 0} { |
| 66 | return "text/x-fossil-wiki" |
| 67 | } |
| 68 | return $mimetype |
| 69 | } |
| 70 |
| --- test/wiki.test | |
| +++ test/wiki.test | |
| @@ -45,25 +45,25 @@ | |
| 45 | # Note: Makes fossil calls, so $CODE and $RESULT will be corrupted |
| 46 | proc get_mime_type {name} { |
| 47 | global CODE RESULT |
| 48 | fossil http << "GET /wiki?name=$name" |
| 49 | if {$CODE != 0} { |
| 50 | return "error: /wiki?name=$name $CODE $RESULT" |
| 51 | } |
| 52 | fossil whatis --type w $name |
| 53 | if {$CODE != 0} { |
| 54 | return "error: fossil whatis --type w $name $CODE $RESULT" |
| 55 | } |
| 56 | set CODE [regexp -line {^artifact:\s*([0-9a-f]+)$} $RESULT match info] |
| 57 | if {$CODE == 0} { |
| 58 | return "error: whatis returned no info for wiki page $name" |
| 59 | } |
| 60 | fossil artifact $info |
| 61 | if {$CODE != 0} { |
| 62 | return "error: fossil artifact $info $CODE $RESULT" |
| 63 | } |
| 64 | set CODE [regexp -line {^N (.*)$} $RESULT match mimetype] |
| 65 | if {$CODE == 0} { |
| 66 | return "text/x-fossil-wiki" |
| 67 | } |
| 68 | return $mimetype |
| 69 | } |
| 70 |