Fossil

Check-in [b40f1ac135]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Wiki test fixes.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b40f1ac135038a0b410d21a882aa1dd78fd831bd201fc38561b4c7cc5296c6ae
User & Date: drh 2019-09-03 20:36:12.638
Context
2019-09-03
21:22
Back out check-in [3ad81c3c499599b4] which was causing sync to fail. check-in: e1962ef67f user: drh tags: trunk
20:36
Wiki test fixes. check-in: b40f1ac135 user: drh tags: trunk
20:22
Make calls to db_begin_write() instead of db_begin_transaction() where appropriate. check-in: 3ad81c3c49 user: drh tags: trunk
2019-08-31
16:23
Merge in trunk latest developments. Closed-Leaf check-in: 08291fec9f user: andybradford tags: test-updates
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/name.c.
190
191
192
193
194
195
196

197
198
199
200
201
202
203
  int rid = 0;
  int nTag;
  int i;
  int startOfBranch = 0;
  const char *zXTag;     /* zTag with optional [...] removed */
  int nXTag;             /* Size of zXTag */
  const char *zDate;     /* Expanded date-time string */


  if( zType==0 || zType[0]==0 ){
    zType = "*";
  }else if( zType[0]=='b' ){
    zType = "ci";
    startOfBranch = 1;
  }







>







190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
  int rid = 0;
  int nTag;
  int i;
  int startOfBranch = 0;
  const char *zXTag;     /* zTag with optional [...] removed */
  int nXTag;             /* Size of zXTag */
  const char *zDate;     /* Expanded date-time string */
  const char *zTagPrefix = "sym";

  if( zType==0 || zType[0]==0 ){
    zType = "*";
  }else if( zType[0]=='b' ){
    zType = "ci";
    startOfBranch = 1;
  }
352
353
354
355
356
357
358



359
360
361
362
363
364
365
366
367
368

369
370
371
372
373
374
375
      rid = db_column_int(&q, 0);
      if( db_step(&q)==SQLITE_ROW ) rid = -1;
    }
    db_finalize(&q);
    if( rid ) return rid;
  }




  /* Symbolic name */
  rid = db_int(0,
    "SELECT event.objid, max(event.mtime)"
    "  FROM tag, tagxref, event"
    " WHERE tag.tagname='sym-%q' "
    "   AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 "
    "   AND event.objid=tagxref.rid "
    "   AND event.type GLOB '%q'",
    zTag, zType
  );

  if( rid>0 ){
    if( startOfBranch ) rid = start_of_branch(rid,1);
    return rid;
  }

  /* Pure numeric date/time */
  zDate = fossil_expand_datetime(zTag, 0);







>
>
>




|



|

>







353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
      rid = db_column_int(&q, 0);
      if( db_step(&q)==SQLITE_ROW ) rid = -1;
    }
    db_finalize(&q);
    if( rid ) return rid;
  }

  if( zType[0]=='w' ){
    zTagPrefix = "wiki";
  }
  /* Symbolic name */
  rid = db_int(0,
    "SELECT event.objid, max(event.mtime)"
    "  FROM tag, tagxref, event"
    " WHERE tag.tagname='%q-%q' "
    "   AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 "
    "   AND event.objid=tagxref.rid "
    "   AND event.type GLOB '%q'",
    zTagPrefix, zTag, zType
  );

  if( rid>0 ){
    if( startOfBranch ) rid = start_of_branch(rid,1);
    return rid;
  }

  /* Pure numeric date/time */
  zDate = fossil_expand_datetime(zTag, 0);
Changes to test/settings.test.
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#       letter.  It also assumes that any output lines that start with a
#       lowercase letter contain a setting name starting at that same point.
#
proc extract_setting_names { data } {
  set names [list]

  foreach {dummy name} [regexp \
      -all -line -inline -- {^([a-z][a-z0-9\-]*) } $data] {
    lappend names $name
  }

  return $names
}

###############################################################################







|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#       letter.  It also assumes that any output lines that start with a
#       lowercase letter contain a setting name starting at that same point.
#
proc extract_setting_names { data } {
  set names [list]

  foreach {dummy name} [regexp \
      -all -line -inline -- {^([a-z][a-z0-9\-]*) ?.*$} $data] {
    lappend names $name
  }

  return $names
}

###############################################################################
Changes to test/tester.tcl.
270
271
272
273
274
275
276



277
278
279
280

281
282
283
284
285
286
287
288






289
290
291
292
293
294
295
      admin-log \
      allow-symlinks \
      auto-captcha \
      auto-hyperlink \
      auto-shun \
      autosync \
      autosync-tries \



      binary-glob \
      case-sensitive \
      clean-glob \
      clearsign \

      crlf-glob \
      crnl-glob \
      default-perms \
      diff-binary \
      diff-command \
      dont-push \
      dotfiles \
      editor \






      empty-dirs \
      encoding-glob \
      exec-rel-paths \
      gdiff-command \
      gmerge-command \
      hash-digits \
      http-port \







>
>
>




>








>
>
>
>
>
>







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
      admin-log \
      allow-symlinks \
      auto-captcha \
      auto-hyperlink \
      auto-shun \
      autosync \
      autosync-tries \
      backoffice-disable \
      backoffice-logfile \
      backoffice-nodelay \
      binary-glob \
      case-sensitive \
      clean-glob \
      clearsign \
      comment-format \
      crlf-glob \
      crnl-glob \
      default-perms \
      diff-binary \
      diff-command \
      dont-push \
      dotfiles \
      editor \
      email-self \
      email-send-command \
      email-send-db \
      email-send-dir \
      email-send-method \
      email-send-relayhost \
      empty-dirs \
      encoding-glob \
      exec-rel-paths \
      gdiff-command \
      gmerge-command \
      hash-digits \
      http-port \
306
307
308
309
310
311
312

313
314
315
316
317
318
319
      proxy \
      relative-paths \
      repo-cksum \
      self-register \
      ssh-command \
      ssl-ca-location \
      ssl-identity \

      th1-setup \
      th1-uri-regexp \
      uv-sync \
      web-browser]

  fossil test-th-eval "hasfeature legacyMvRm"








>







316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
      proxy \
      relative-paths \
      repo-cksum \
      self-register \
      ssh-command \
      ssl-ca-location \
      ssl-identity \
      tclsh \
      th1-setup \
      th1-uri-regexp \
      uv-sync \
      web-browser]

  fossil test-th-eval "hasfeature legacyMvRm"

Changes to test/wiki.test.
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# "text/x-fossil-wiki" (the default mimetype for rendering)
# if the N card is omitted in the manifest.
# Note: Makes fossil calls, so $CODE and $RESULT will be corrupted
proc get_mime_type {name} {
  global CODE RESULT
  fossil http << "GET /wiki?name=$name"
  if {$CODE != 0} {
    return error: /wiki?name=$name $CODE $RESULT"
  }
  set CODE [regexp {href="/info/([0-9a-f]+)"} $RESULT match info]
  if {$CODE == 0} {
    return "error: No info link found for wiki page $name"
  }
  fossil http << "GET /artifact/$info"
  if {$CODE != 0} {
    return "error: /artifact/$info $CODE $RESULT"
  }
  set CODE [regexp {<pre>(.*)</pre>} $RESULT match pre]
  if {$CODE == 0} {
    return "error: No pre block in /artifact/$info"
  }
  set CODE [regexp -line {^N (.*)$} $pre match mimetype]
  if {$CODE == 0} {
    return "text/x-fossil-wiki"
  }
  return $mimetype
}









|

|
|
|

|
|
|

|
|
|

|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# "text/x-fossil-wiki" (the default mimetype for rendering)
# if the N card is omitted in the manifest.
# Note: Makes fossil calls, so $CODE and $RESULT will be corrupted
proc get_mime_type {name} {
  global CODE RESULT
  fossil http << "GET /wiki?name=$name"
  if {$CODE != 0} {
    return "error: /wiki?name=$name $CODE $RESULT"
  }
  fossil whatis --type w $name
  if {$CODE != 0} {
    return "error: fossil whatis --type w $name $CODE $RESULT"
  }
  set CODE [regexp -line {^artifact:\s*([0-9a-f]+)$} $RESULT match info]
  if {$CODE == 0} {
    return "error: whatis returned no info for wiki page $name"
  }
  fossil artifact $info
  if {$CODE != 0} {
    return "error: fossil artifact $info $CODE $RESULT"
  }
  set CODE [regexp -line {^N (.*)$} $RESULT match mimetype]
  if {$CODE == 0} {
    return "text/x-fossil-wiki"
  }
  return $mimetype
}