3r1co / hg4j

Automatically exported from code.google.com/p/hg4j
GNU General Public License v2.0
0 stars 1 forks source link

Revlog#walk doesn't handle ParentInspector correctly with start revision other than 0, fails with AIOOBE #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
#walk(int start, int end, final Revlog.Inspector inspector)

For the ParentInspector, there's an assumption in the code that all parents 
come before the revision being visited. This holds true only when we iterate 
from the very first revision:

Synopsis:
start == 6, end == 7 and parentOf(start) == 5. allRevisions.length == 2, 
allRevisions[parentOf(start)] => AIOOBE 

Original issue reported on code.google.com by tikhomir...@gmail.com on 6 Jun 2012 at 6:21

GoogleCodeExporter commented 8 years ago
Fix delivered into smartgit3 branch, revision 2e402c12ebc6.
The issue gonna be closed once merged to default branch

Original comment by tikhomir...@gmail.com on 6 Jun 2012 at 7:25

GoogleCodeExporter commented 8 years ago
The defect doesn't affect the code that uses it in hg4j-1.0 (all the uses are 
(0,TIP). Unless users would play with experimental Revlog.indexWalk method, 
they won't get into trouble.

The fix didn't make it into 1.0, merged into default with the rest of smartgit3 
changes post-1.0.

Test: TestAuxUtilities#testRevisionDescendants

Original comment by tikhomir...@gmail.com on 11 Jul 2012 at 7:47