Deleting overwritten shadow tiddlers that are identical to the shadow

43 views
Skip to first unread message

TonyM

unread,
Apr 26, 2020, 6:55:35 PM4/26/20
to TiddlyWiki
Folks,

In an attempt to fix a Wiki I have as mentioned here 5.1.22 Upgrade Problem - TypeError
I need to establish a method to delete a pile of overidden shadow tiddlers.
[all[shadows+tiddlers]]

I need a way to test if there is non-trivial differences between the tiddlers ie fields and text have not changed (perhaps excluding created creator modified and modifier etc...) and delete only "identical tiddlers".

Can anyone think how to test for this?

Thanks in Advance
Tony




TonyM

unread,
Apr 26, 2020, 7:24:35 PM4/26/20
to TiddlyWiki
Flks,

I am progressing on this;

The following code works on tiddlywiki.com and editing the $:/Acknowledgements tiddler
<$list filter="[all[shadows+tiddlers]prefix[$:/Ack]]">
  <$set name=source value={{{ [all[current]shadowsource[]] }}}>
     <!--$diff-text source={{FirstTiddler}} dest=<<currentTiddler>> ></$diff-text-->
    <$link/> <<source>><br>
    subTiddler Fields
    <$list filter="[<currentTiddler>subtiddlerfields<source>]">

    </$list>
    Tiddler fields
    <$list filter="[<currentTiddler>fields[]]">

    </$list>
  </$set>
</$list>

I suppose what I need to know is how to compare the field contents (including text) by referencing the shadow version contents of each field. Unless there way a whole of tiddler comparison method from which we could exclude some fields.

Regards
Tony

TonyM

unread,
Apr 26, 2020, 8:14:43 PM4/26/20
to TiddlyWiki
Folks, 

With the Previous code snipit I have discovered that some shadows+tiddlers have a modified date field and others do not.

I would think this would be sufficient to identify any tiddler I have changed intentionally as the modified is set by any interactive edits.

So now my target is to delete "[all[shadows+tiddlers]is[shadow]!has[modified]]" as most likely overridden system tiddlers who have not actually changed.

Does this sound like a reasonable assumption?

Regards
Tony
Reply all
Reply to author
Forward
0 new messages