##// END OF EJS Templates
largefiles: sync up `largefilesdirstate` methods with `dirstate` base class...
largefiles: sync up `largefilesdirstate` methods with `dirstate` base class As it currently stands, pytype infers the `dirstate` class (and anything else decorated with `@interfaceutil.implementer`) as `Any`. When that is worked around, it suddenly noticed that most of these methods don't exist in the `dirstate` class anymore. Since they only called into the missing methods and there's no test failures, we can assume these are never called, and they can be dropped. In addition, PyCharm flagged `set_tracked()` and `_ignore()` as not overriding a superclass method with the same arguments. The missing default parameter for the former was the obvious issue. I'm guessing that the latter was named wrong because while there is `_ignore()` in the base class, it takes no arguments and returns a matcher. The `_ignorefiles()` superclass method also takes no args, and returns a list of bytes. The `_ignorefileandline()` superclass method DOES take a file, but returns a tuple. Therefore, the closest match is `_dirignore()`, which takes a file AND returns a bool. No idea why this needs to be overridden though.

File last commit:

r52147:f94c1033 default
r52700:0b2c978f default
Show More
revlog.py
62 lines | 2.3 KiB | text/x-python | PythonLexer
test: extract some generic data and utility from test-rust-ancestor.py...
r44397 import unittest
# picked from test-parse-index2, copied rather than imported
# so that it stays stable even if test-parse-index2 changes or disappears.
data_non_inlined = (
b'\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01D\x19'
b'\x00\x07e\x12\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff'
b'\xff\xff\xff\xff\xd1\xf4\xbb\xb0\xbe\xfc\x13\xbd\x8c\xd3\x9d'
b'\x0f\xcd\xd9;\x8c\x07\x8cJ/\x00\x00\x00\x00\x00\x00\x00\x00\x00'
b'\x00\x00\x00\x00\x00\x00\x01D\x19\x00\x00\x00\x00\x00\xdf\x00'
b'\x00\x01q\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\xff'
b'\xff\xff\xff\xc1\x12\xb9\x04\x96\xa4Z1t\x91\xdfsJ\x90\xf0\x9bh'
b'\x07l&\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
b'\x00\x01D\xf8\x00\x00\x00\x00\x01\x1b\x00\x00\x01\xb8\x00\x00'
b'\x00\x01\x00\x00\x00\x02\x00\x00\x00\x01\xff\xff\xff\xff\x02\n'
b'\x0e\xc6&\xa1\x92\xae6\x0b\x02i\xfe-\xe5\xbao\x05\xd1\xe7\x00'
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01F'
b'\x13\x00\x00\x00\x00\x01\xec\x00\x00\x03\x06\x00\x00\x00\x01'
b'\x00\x00\x00\x03\x00\x00\x00\x02\xff\xff\xff\xff\x12\xcb\xeby1'
b'\xb6\r\x98B\xcb\x07\xbd`\x8f\x92\xd9\xc4\x84\xbdK\x00\x00\x00'
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00'
)
Georges Racinet
rust-index: using the `hg::index::Index` in ancestors iterator and lazy set...
r52132 from ..revlogutils.constants import REVLOGV1
test: extract some generic data and utility from test-rust-ancestor.py...
r44397
try:
Matt Harbison
typing: disable import error warnings that are already handled...
r47543 from ..cext import parsers as cparsers # pytype: disable=import-error
test: extract some generic data and utility from test-rust-ancestor.py...
r44397 except ImportError:
cparsers = None
Georges Racinet
rust-index: using the `hg::index::Index` in ancestors iterator and lazy set...
r52132 try:
Georges Racinet on incendie.racinet.fr
rust-index: renamed `MixedIndex` as `Index`...
r52147 from ..rustext.revlog import ( # pytype: disable=import-error
Index as RustIndex,
)
Georges Racinet
rust-index: using the `hg::index::Index` in ancestors iterator and lazy set...
r52132 except ImportError:
Georges Racinet on incendie.racinet.fr
rust-index: renamed `MixedIndex` as `Index`...
r52147 RustIndex = None
Georges Racinet
rust-index: using the `hg::index::Index` in ancestors iterator and lazy set...
r52132
test: extract some generic data and utility from test-rust-ancestor.py...
r44397
@unittest.skipIf(
cparsers is None,
'The C version of the "parsers" module is not available. It is needed for this test.',
)
class RevlogBasedTestBase(unittest.TestCase):
Georges Racinet
rust-index: using the `hg::index::Index` in ancestors iterator and lazy set...
r52132 def parseindex(self, data=None):
if data is None:
data = data_non_inlined
return cparsers.parse_index2(data, False)[0]
Georges Racinet on incendie.racinet.fr
rust-python-testing: separated base test classes...
r52137
@unittest.skipIf(
Georges Racinet on incendie.racinet.fr
rust-index: renamed `MixedIndex` as `Index`...
r52147 RustIndex is None,
Georges Racinet on incendie.racinet.fr
rust-python-testing: separated base test classes...
r52137 'The Rust index is not available. It is needed for this test.',
)
class RustRevlogBasedTestBase(unittest.TestCase):
Georges Racinet
rust-index: using the `hg::index::Index` in ancestors iterator and lazy set...
r52132 def parserustindex(self, data=None):
if data is None:
data = data_non_inlined
Georges Racinet on incendie.racinet.fr
rust-python-testing: separated base test classes...
r52137 # not inheriting RevlogBasedTestCase to avoid having a
# `parseindex` method that would be shadowed by future subclasses
# this duplication will soon be removed
Georges Racinet on incendie.racinet.fr
rust-index: renamed `MixedIndex` as `Index`...
r52147 return RustIndex(data, REVLOGV1)