Fossil Wrapper

Check-in [a721f86fe9]
Login

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

Overview
Comment:give up on hard-coding a list of valid commands (to decrease latency minimally) and use a dynamic list instead.
Timelines: family | ancestors | descendants | both | dresden
Files: files | file ages | folders
SHA1: a721f86fe9685136bb00456317cac5fdf2db13bf
User & Date: j 2019-10-16 13:26:33
Context
2019-11-13
13:17
more flexible pattern for localizing the sha1/3 hashes (allowing for adjusting the no. of displayed hash digits via `fossil set hash-digits'). empirically, `fossil' displays at least 6 digits irrespective of a possibly smaller hash-digits setting. hence the {6,} or {2,} repetitions in the assorted patterns. check-in: dee40a390a user: j tags: dresden
2019-10-16
13:26
give up on hard-coding a list of valid commands (to decrease latency minimally) and use a dynamic list instead. check-in: a721f86fe9 user: j tags: dresden
2019-07-21
16:05
regression fix in `clone' interceptor. check-in: 24053a7df2 user: j tags: dresden
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fsl.

1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
# `fossil' command, simply print its body, otherwise only print any leading
# comment block found in the interceptor's definition and append the
# help output for the corresponding `fossil' command.
# ------------------------------------------------------------------------
    set expansion [expand [lrange $params 1 end] 1]
    set command   [first $expansion]

    # compile a list of the `fossil' commands (ignoring the `test' commands):
    # the dynamic variant would be to ask `fossil' each time but this
    # increases latency of `fsl' somewhat (but only by about 10%
    # on my machine...):
    #
    #    catch {exec fossil help --all} foscom
    #
    # so for now we use a static list (resulting from a dump of the above
    # command:

    set foscom {
      3-way-merge    clone          help           redo           sync         
      add            close          http           remote-url     tag          
      addremove      co             import         rename         tarball      
      all            commit         info           reparent       ticket       
      amend          configuration  init           revert         timeline     
      annotate       dbstat         leaves         rm             ui           
      artifact       deconstruct    ls             rss            undo         
      attachment     delete         md5sum         scrub          unpublished  
      bisect         descendants    merge          search         unset        
      blame          diff           mv             server         unversioned  
      branch         email          new            settings       update       
      bundle         export         open           sha1sum        user         
      cache          extras         praise         sha3sum        uv           
      cat            finfo          publish        shell          version      
      cgi            forget         pull           sql            whatis       
      changes        fts-config     purge          sqlar          wiki         
      checkout       gdiff          push           sqlite3        zip          
      ci             grep           rebuild        stash        
      clean          hash-policy    reconstruct    status       
    }

    # regularize foscom: bracket all commands with _single_ blanks
    # (including first and last one ...) in order to facilitate further
    # processing:
    regsub -all {^|\n|$} $foscom { } foscom
    regsub -all {[ ]+} $foscom { } foscom








<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1235
1236
1237
1238
1239
1240
1241





1242

























1243
1244
1245
1246
1247
1248
1249
# `fossil' command, simply print its body, otherwise only print any leading
# comment block found in the interceptor's definition and append the
# help output for the corresponding `fossil' command.
# ------------------------------------------------------------------------
    set expansion [expand [lrange $params 1 end] 1]
    set command   [first $expansion]






    catch {exec fossil help --all} foscom


























    # regularize foscom: bracket all commands with _single_ blanks
    # (including first and last one ...) in order to facilitate further
    # processing:
    regsub -all {^|\n|$} $foscom { } foscom
    regsub -all {[ ]+} $foscom { } foscom