[Lxr-dev] [ lxr-Bugs-3520039 ] With CVS, only 'head' release displayed
Brought to you by:
ajlittoz
From: SourceForge.net <no...@so...> - 2012-04-21 08:25:45
|
Bugs item #3520039, was opened at 2012-04-21 01:10 Message generated for change (Comment added) made by ajlittoz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3520039&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: SCM support Group: current cvs >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Andre-Littoz (ajlittoz) Assigned to: Andre-Littoz (ajlittoz) Summary: With CVS, only 'head' release displayed Initial Comment: CVS release 1.95 for Common.pm tried to sort global variable initialisation by moving $pathname after varaible 'v' being set to the value of $releaseid. Unhappily there is an egg-and-hen problem since $releaseid is set by sub clean_release which references {'variables'}{'v'}{'range'}. It is usually OK but it may be a sub (as in the CVS example in lxr.conf) to compute the range with a call to the SCM class object with argument $pathname to hold the file name. Since it is undefined at that time, CVS object returns 'head' by default. Afterwards, it is impossible to change version. GIT uses a different scheme (reading the stored list of releases from a file) and is not affected by this race condition. Plain files usually explicitly enumerates the versions and are also not affected. ---------------------------------------------------------------------- >Comment By: Andre-Littoz (ajlittoz) Date: 2012-04-21 01:25 Message: There is practically no perfect way to break this vicious circle. Since clean-release only aims at "canonise" $pathname by ensuring a trailing slash if it is a directory, it seems acceptable to set $pathname to the URL path temporarily (i.e. only for the purpose of computing the versions set of the current file) which means subs allreleases and allrevisions must not rely on $pathname having the / suffix if it is a directory. Thus the critical section now reads: $pathname = $HTTP->{'path_info'}; # <- added line $releaseid = clean_release($config->variable('v')); $config->variable('v', $releaseid); $pathname = fixpaths($HTTP->{'path_info'}); For efficiency, the second $pathname = could even be written: $pathname = fixpaths($pathname); and it gives a visual clue that it is not an accidental duplication. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3520039&group_id=27350 |