lazyindex: speed up __getitem__
This function is fairly performance sensitive, so we make a couple
ugly tweaks:
- keep all entries packed so we needn't test entry types
- fold index lookup/load into unpack call to eliminate
local variable setting
% file replaced with directory
adding a
% should fail - would corrupt dirstate
abort: file named 'a' already in dirstate
% directory replaced with file
adding a/a
% should fail - would corrupt dirstate
abort: directory named 'a' already in dirstate
% directory replaced with file
adding b/c/d
% should fail - would corrupt dirstate
abort: directory named 'b' already in dirstate