Menu

#181 Selection of an SCM file randomly returns head v

current_cvs
closed-fixed
SCM support (7)
7
2011-04-14
2011-04-14
No

When SCM is activated (cvs, BK or GIT), selecting a file version randomly displays 'head' version though the SCM information is correctly parsed and stored. Versions are dynamically defined into variable 'v' as per example in lxr.conf through the use of $files->allreleases(LXR::Common::pathname) function call.
Cause is in Common.pm sub httpinit:
- arguments of the query request are checked and cleaned, notably 'v' and $HTTP->{'param'}->{'file'}
- order is 'v' then 'file' which sets global variable $pathname.
But, check for 'v' in clean_release calls varrange to garantee that the requested version exists otherwise 'v' is reset to vardefault.
With SCM, varrange may be the above function call using $pathname as argument. At that time, it has not yet been correctly initialised. It may or not contain value from a previous script invocation. Anyway, the value is wrong and may reference an incorrect file for which the 'v' value may not exist and we revert to default value, usually 'head'.

To correct, just reverse the order of the tests.

Discussion

  • Andre-Littoz

    Andre-Littoz - 2011-04-14

    This has now been fixed in CVS.

    If you can install the new version and check that it solves your
    problem, then it would be very useful.

    Thanks for reporting this defect and helping to make LXR better.

     
  • Andre-Littoz

    Andre-Littoz - 2011-04-14

    Corrected in CVS

     
  • Andre-Littoz

    Andre-Littoz - 2011-04-14
    • status: open --> open-fixed
     
  • Andre-Littoz

    Andre-Littoz - 2011-04-14
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.