marmoute created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers.
REVISION SUMMARY This will help us to introduce some test around the data currently written on disk. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7842 AFFECTED FILES mercurial/revlogutils/nodemap.py CHANGE DETAILS diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py --- a/mercurial/revlogutils/nodemap.py +++ b/mercurial/revlogutils/nodemap.py @@ -214,6 +214,14 @@ return int(hex_digit, 16) +class Block(dict): + """represent a block of the Trie + + contains up to 16 entry indexed from 0 to 15""" + + pass + + def _build_trie(index): """build a nodemap trie @@ -222,7 +230,7 @@ Each block is a dictionnary with key in `[0, 15]`. Value are either another block or a revision number. """ - root = {} + root = Block() for rev in range(len(index)): hex = nodemod.hex(index[rev][7]) _insert_into_block(index, 0, root, rev, hex) @@ -251,7 +259,7 @@ other_hex = nodemod.hex(index[entry][7]) other_rev = entry while current_hex[level] == other_hex[level]: - new = {} + new = Block() block[_to_int(current_hex[level])] = new block = new level += 1 To: marmoute, #hg-reviewers Cc: mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel