Mercurial > hg
comparison mercurial/subrepo.py @ 49389:093e5c274f54
typing: suppress a few pyi-errors with more recent pytype
Not sure what's going on here, but these were flagged with pytype 2022.03.21.
We can't update to something much more recent, because newer versions complain
about various `attr` uses.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 13 Jul 2022 11:30:13 -0400 |
parents | 642e31cb55f0 |
children | b9fcf54030d7 |
comparison
equal
deleted
inserted
replaced
49383:de2e158c380a | 49389:093e5c274f54 |
---|---|
1148 def _wcrevs(self): | 1148 def _wcrevs(self): |
1149 # Get the working directory revision as well as the last | 1149 # Get the working directory revision as well as the last |
1150 # commit revision so we can compare the subrepo state with | 1150 # commit revision so we can compare the subrepo state with |
1151 # both. We used to store the working directory one. | 1151 # both. We used to store the working directory one. |
1152 output, err = self._svncommand([b'info', b'--xml']) | 1152 output, err = self._svncommand([b'info', b'--xml']) |
1153 doc = xml.dom.minidom.parseString(output) | 1153 doc = xml.dom.minidom.parseString(output) # pytype: disable=pyi-error |
1154 entries = doc.getElementsByTagName('entry') | 1154 entries = doc.getElementsByTagName('entry') |
1155 lastrev, rev = b'0', b'0' | 1155 lastrev, rev = b'0', b'0' |
1156 if entries: | 1156 if entries: |
1157 rev = pycompat.bytestr(entries[0].getAttribute('revision')) or b'0' | 1157 rev = pycompat.bytestr(entries[0].getAttribute('revision')) or b'0' |
1158 commits = entries[0].getElementsByTagName('commit') | 1158 commits = entries[0].getElementsByTagName('commit') |
1172 True if any of these changes concern an external entry and missing | 1172 True if any of these changes concern an external entry and missing |
1173 is True if any change is a missing entry. | 1173 is True if any change is a missing entry. |
1174 """ | 1174 """ |
1175 output, err = self._svncommand([b'status', b'--xml']) | 1175 output, err = self._svncommand([b'status', b'--xml']) |
1176 externals, changes, missing = [], [], [] | 1176 externals, changes, missing = [], [], [] |
1177 doc = xml.dom.minidom.parseString(output) | 1177 doc = xml.dom.minidom.parseString(output) # pytype: disable=pyi-error |
1178 for e in doc.getElementsByTagName('entry'): | 1178 for e in doc.getElementsByTagName('entry'): |
1179 s = e.getElementsByTagName('wc-status') | 1179 s = e.getElementsByTagName('wc-status') |
1180 if not s: | 1180 if not s: |
1181 continue | 1181 continue |
1182 item = s[0].getAttribute('item') | 1182 item = s[0].getAttribute('item') |
1317 return True | 1317 return True |
1318 | 1318 |
1319 @annotatesubrepoerror | 1319 @annotatesubrepoerror |
1320 def files(self): | 1320 def files(self): |
1321 output = self._svncommand([b'list', b'--recursive', b'--xml'])[0] | 1321 output = self._svncommand([b'list', b'--recursive', b'--xml'])[0] |
1322 doc = xml.dom.minidom.parseString(output) | 1322 doc = xml.dom.minidom.parseString(output) # pytype: disable=pyi-error |
1323 paths = [] | 1323 paths = [] |
1324 for e in doc.getElementsByTagName('entry'): | 1324 for e in doc.getElementsByTagName('entry'): |
1325 kind = pycompat.bytestr(e.getAttribute('kind')) | 1325 kind = pycompat.bytestr(e.getAttribute('kind')) |
1326 if kind != b'file': | 1326 if kind != b'file': |
1327 continue | 1327 continue |