Fossil

Timeline
Login

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

About branch generated-tkt-mimetype

When a ticket is created or modified Fossil extends BACKLINK table with the links extracted from the J-cards of the ticket change artifact. That extraction requires the knowledge of which markup is used.

Previously Fossil derived this information solely from the value of J-card named "mimetype"1, which was considered only if a regular "mimetype" column was defined in TICKET or TICKETCHNG table.

This branch adds the ability to specify mimetypes using GENERATED "mimetype" columns.
It implements the following rules:

  1. If either TICKET or TICKETCHNG table has a regular (not generated) "mimetype" column, then traditional processing is applied (as schetched in the beginning).

  2. Otherwise: if just one of the above tables has generated "mimetype" column then the generated value in the corresponding row is used.

  3. Otherwise: if just one of two generated values is not NULL then that value is used for all fields.

  4. Otherwise (when both generated values are not NULL):

    • all fields that are defined in the TICKETCHNG table are processed using mimetype from the TICKETCHNG table;
    • the rest fields (that are specific to TICKET table) are processed using mimetype from the TICKET table.

If a NULL value has to be interpreted as mimetype it works as Fossil-Wiki. That also applies to the case when "mimetype" column is missing in both TICKET and TICKETCHNG.

See forum thread 40c1208a0f84 for rationale and discussion.


  1. ^ Here and further the naming "mimetype" is case-sensitive. Presumably due to performance considerations.
7 check-ins related to "generated-tkt-mimetype"
2022-05-24
20:32
If neither <var>TICKET</var> nor <var>TICKETCHNG</var> table has regular "mimetype" column then generated "mimetype" columns of these two tables are queried and used during the extraction of backlinks from ticket change artifacts. See [forum:/forumpost/40c1208a0f84fabe|forum post 40c1208a0f84] for rationale. ... (check-in: 6fb642c02b user: george tags: trunk)
2022-05-18
22:52
Fix a couple of invokations of <code>backlink_extract()</code> that were overlooked in the previous check-in. ... (Closed-Leaf check-in: 33c67c2851 user: george tags: generated-tkt-mimetype)
20:21
Add support for generated "mimetype" column in the <var>TICKET</var> table. Introduce integer mimetype codes and refactor <code>backlink_extract()</code> accordingly. Make the overall handling of the generated "mimetype" columns a bit more clear. ... (check-in: e39f77906e user: george tags: generated-tkt-mimetype)
2022-05-14
19:12
A tiny optimization inside of <tt>ticket_insert()</tt>: rearrange two <tt>db_finalize()</tt> calls in order to avoid additional <tt>malloc()</tt> for <var>zMimetype</var>. ... (check-in: 563c6b9e4e user: george tags: generated-tkt-mimetype)
18:27
If "<var>mimetype</var>" column of the <var>TICKETCHNG</var> table is a [https://www.sqlite.org/gencol.html|generated column], than use these generated values for extraction of backlinks from the ticket-changes. ... (check-in: 5ab73ab8c7 user: george tags: generated-tkt-mimetype)
17:42
Fix a subtle bug in <code>ticket_insert()</code> which may lead to redundant rows in the BACKLINK table. The bug appeared in [7c13a57358ae]. ... (check-in: 3b42738e36 user: george tags: generated-tkt-mimetype)
14:38
Adds minor output to stash command to alert users when a stash is successful. See [forum:fd2405eff30f4c73 | forum post fd2405eff30f4c73] for discussion. ... (check-in: 07d739b4ba user: andybradford tags: trunk)