linelog: correct the default value of `annotateresult.lines`
authorMatt Harbison <matt_harbison@yahoo.com>
Tue, 23 Jul 2024 19:05:26 -0400
changeset 51727 a65c2dddbf5d
parent 51726 587153c96fe3
child 51728 2e9e62242451
linelog: correct the default value of `annotateresult.lines` This was flagged by pytype once it was tricked into using the standard `attr` package instead of the vendored copy.
mercurial/linelog.py
--- a/mercurial/linelog.py	Tue Jul 23 19:01:16 2024 -0400
+++ b/mercurial/linelog.py	Tue Jul 23 19:05:26 2024 -0400
@@ -21,6 +21,11 @@
 
 import abc
 import struct
+import typing
+
+from typing import (
+    List,
+)
 
 from .thirdparty import attr
 from . import pycompat
@@ -45,7 +50,7 @@
 @attr.s
 class annotateresult:
     rev = attr.ib()
-    lines = attr.ib(type=bytearray)
+    lines = attr.ib(type=List[lineinfo])
     _eof = attr.ib()
 
     def __iter__(self):
@@ -400,7 +405,7 @@
 
     def annotate(self, rev):
         pc = 1
-        lines = []
+        lines: List[lineinfo] = []
         executed = 0
         # Sanity check: if instructions executed exceeds len(program), we
         # hit an infinite loop in the linelog program somehow and we