comparison prompt.py @ 147:7718e4d9a019

Fix hg "status" object changing from tuple to object This should still work with the older tuple version as well because it had properties and index-based access was a hack
author IBBoard <dev@ibboard.co.uk>
date Sat, 21 Mar 2020 18:51:07 +0000
parents c1520aabcdd4
children 1c3ec0b529c4
comparison
equal deleted inserted replaced
146:c67c56b569d8 147:7718e4d9a019
312 def _root(m): 312 def _root(m):
313 return _with_groups(m.groups(), repo.root) if repo.root else b'' 313 return _with_groups(m.groups(), repo.root) if repo.root else b''
314 314
315 def _status(m): 315 def _status(m):
316 g = m.groups() 316 g = m.groups()
317 317 st = repo.status(unknown=True)
318 st = repo.status(unknown=True)[:5] 318 modified = any([st.modified, st.added, st.removed, st.deleted])
319 modified = any(st[:4]) 319 unknown = len(st.unknown) > 0
320 unknown = len(st[-1]) > 0
321 320
322 flag = b'' 321 flag = b''
323 if b'|modified' not in g and b'|unknown' not in g: 322 if b'|modified' not in g and b'|unknown' not in g:
324 flag = b'*' if modified else b'?' if unknown else b'' 323 flag = b'*' if modified else b'?' if unknown else b''
325 else: 324 else: