SID-00945: Formatted Search, changes to two version back
Status: |
Answered |
TWiki version: |
4.2.4 |
Perl version: |
|
Category: |
CategorySearch |
Server OS: |
|
Last update: |
13 years ago |
According to the docs for Formatted Search,
$changes(n)
will give me changes between the latest version and version n.
However, in a search, I really can't guess what
n should be. I'm more likely to want to see changes between the latest and two back, or three back, than some explict
n.
I tried
%SEARCH{".*" type="regex" nosearch="on" noheader="on"
newline="%BR%" order="modified" limit="20" reverse="on"
format="| [[$web.$topic][$topic]] | r $rev | $date -- $wikiname | $changes | $changes($percntCALC{$EVAL($rev - 1)}$percnt) | "}%
But
$changes($percntCALC{$EVAL($rev - 1)}$percnt)
isn't giving me what I want.
I assume there's an "order of evaluation" problem.
Can I do what I want to do?
If so, how?
--
VickiBrown - 2010-08-12
Discussion and Answer
The doc is correct, I just checked the code. Whoever designed this spec did not think about usability. Yes, relative version number would be more usable.
CALC will not work here because you need the result of the calculated version number for each search hit, but before
$changes
is evaluated, which is not possible.
I recommend to post a feature request. Possible spec to remain compatible: Use a negative number to indicate relative version number compared to the current top version. For example, a
$changes(-2)
shows the difference between the two most recent revisions.
--
PeterThoeny - 2010-08-15
Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the
TWiki consultants if you need timely help. We invite you to
get involved with the community, it is more likely you get community support if you support the open source project!
--
PeterThoeny - 2010-10-06
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.