D7603: cext-revlog: fixed __delitem__ for uninitialized nodetree

gracinet (Georges Racinet) phabricator at mercurial-scm.org
Thu Dec 12 12:38:46 EST 2019


gracinet added a comment.


  Here's a quickfix that works for me for both pure and C
  
    -- a/tests/test-parseindex2.py Thu Dec 05 20:41:23 2019 +0100
    +++ b/tests/test-parseindex2.py Thu Dec 12 18:34:28 2019 +0100
    @@ -18,6 +18,7 @@
         node as nodemod,
         policy,
         pycompat,
    +    util,
     )
     
     parsers = policy.importmod('parsers')
    @@ -267,11 +268,12 @@
             appendrev(6)
             self.assertEqual(len(index), 7)
     
    -        del index[1:7]
    +        del index[1:-1]
     
             # assertions that failed before correction
             self.assertEqual(len(index), 1)  # was 4
    -        self.assertEqual(index.headrevs(), [0])  # gave ValueError
    +        if util.safehasattr(index, 'headrevs'):  # not implemented in pure
    +            self.assertEqual(index.headrevs(), [0])  # gave ValueError
  
  Explanation: the C version would allow either -1 or actual length, the pure version just allows -1. The pure version does not have algorithms such as `headrevs`, they are implemented in revlog.py
  
  I can redo that cleanly, just tell me the expected way.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7603/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7603

To: gracinet, #hg-reviewers
Cc: martinvonz, mercurial-devel


More information about the Mercurial-devel mailing list