Bugs item #3267251, was opened at 2011-04-01 05:48
Message generated for change (Comment added) made by ajlittoz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3267251&group_id=27350
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Browsing
>Group: current cvs
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Andre-Littoz (ajlittoz)
>Assigned to: Andre-Littoz (ajlittoz)
Summary: Incomplete design of 'maps' feature
Initial Comment:
Release 0.9.9 and earlier
lxr.conf 'maps' is a great device to select a file among many directories based on the value of variables. It works fine when clicking on a link e.g. in an #include. You are warped directly to the desired file. But if you want to compare this file to another one using "diff", LXR is confused about the second target file, because it is unable to correctly generate the path to the second file: it uses the transformed path of the first file, then tries to apply 'maps' and very often discovers that the file designated by this multiple processed path does not exist.
How can we circumvent that? Comments and advice wanted.
There is an incomplete implementation of something (what? it is lost in time) in httpinit: a parameter named 'file' seems to be "reserved". Could it be used to keep the original path? The function mappath would then be applied in httpinit and the result used as the target file.
I have not yet thought about it, nor determined the exact circumstances under which the aforementioned error occurs. At least, I know of it in diff.
Before going ahead, I would appreciate collecting events where it has caused trouble.
----------------------------------------------------------------------
>Comment By: Andre-Littoz (ajlittoz)
Date: 2012-01-23 08:11
Message:
State transition between LXR invocation has been clarified.
Target file designation is done through the 'variables', namely, 'v,
eventually 'a' and others.
State starting point is stored in arguments whose names start with '_' (so
that they are not confused with 'variables').
_file argument contains the non-mapped file path (only for #include files
since this is the only place where mappath is applied).
If the desired file version needs 'variables' changes, the changed variable
names are prefixed with '$', e.g. $v.
When a query string is received with _file and optional $variables, _file
and $variables are combined to select a file after mappath substitution. If
that selection succeeds, this file will override the content of $pathname
which was initialised with the usual target file.
With such an algorithm, successive 'variables' changes will always result
in the correct file being selected, even revert to the initial file after
many changes.
This algorithm involves many changes in include processing, initialisation,
link management, ... but globally involves few lines of code.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3267251&group_id=27350