changeset 51727:a65c2dddbf5d

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.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 23 Jul 2024 19:05:26 -0400
parents 587153c96fe3
children 2e9e62242451
files mercurial/linelog.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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