This is an archive of the discontinued Mercurial Phabricator instance.

pure: fix pure-Python revlog to support [0] lookups on empty log
AbandonedPublic

Authored by durin42 on Aug 15 2018, 11:02 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

This fixes many many test failures in pure mode, but it appears to be a material behavior difference from the cext version. I tried adding this test:

def testindex0onemptyrevlog(self):
    want = (0, 0, 0, -1, -1, -1, -1, nullid)
    index, junk = parsers.parse_index2('', True)
    got = index[0]
    self.assertEqual(want, got)

to test-parseindex2.py, and it fails on native (but passes --pure
after this patch). I'm unclear what the correct behavior *should* be,
but hopefully this guides someone to a fix...

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

durin42 created this revision.Aug 15 2018, 11:02 PM

I think the correct behavior should be what it is before this patch. I
think that matches the native code I think we should fix the callers
instead. There might be some callers in pure code that I forgot to update.
Can you check where it's called from with [0] on an empty log? Otherwise I
can look at it when I get back from vacation in a few days.

I think the correct behavior should be what it is before this patch. I
think that matches the native code I think we should fix the callers
instead. There might be some callers in pure code that I forgot to update.
Can you check where it's called from with [0] on an empty log? Otherwise I
can look at it when I get back from vacation in a few days.

Okay, that's comforting in a way. :)

I can't make sense of the failures, so I'll probably just leave it for you (no pure code is obviously in the tb, so something else must be amiss somewhere. Ugh.)

I think the correct behavior should be what it is before this patch. I
think that matches the native code I think we should fix the callers
instead. There might be some callers in pure code that I forgot to update.
Can you check where it's called from with [0] on an empty log? Otherwise I
can look at it when I get back from vacation in a few days.

Okay, that's comforting in a way. :)
I can't make sense of the failures, so I'll probably just leave it for you (no pure code is obviously in the tb, so something else must be amiss somewhere. Ugh.)

Looks like Yuya fixed the problem in 13a1901176 (thanks!)

I think the correct behavior should be what it is before this patch. I
think that matches the native code I think we should fix the callers
instead. There might be some callers in pure code that I forgot to update.
Can you check where it's called from with [0] on an empty log? Otherwise I
can look at it when I get back from vacation in a few days.

Okay, that's comforting in a way. :)
I can't make sense of the failures, so I'll probably just leave it for you (no pure code is obviously in the tb, so something else must be amiss somewhere. Ugh.)

Looks like Yuya fixed the problem in 13a1901176 (thanks!)

Sorry, mistaken copy, should have been 65d5de11.

yuja added a subscriber: yuja.Aug 18 2018, 4:09 AM

As a side note, prefix lookup of nullhex no longer works with pure since
null is excluded from the index.

In D4292#66551, @yuja wrote:

As a side note, prefix lookup of nullhex no longer works with pure since
null is excluded from the index.

Yep, I had noticed. I have a fix that I'll send after running all pure and native tests on it will hopefully be the end of this series of patches fixing things I missed in a3dacabd476b.

durin42 abandoned this revision.Aug 30 2018, 5:24 PM