# HG changeset patch # User Sietse Brouwer # Date 1590497878 -7200 # Node ID e2d60e4e3caf5c158dcbe7f3ed63e2871b3ea5bd # Parent cc789a5baf4a4fbb266ccc19b6c223160617abad Fix error: don't assume status is a tuple This fix also works with older versions of Mercurial. `repo.status()` used to return a named tuple; since 5.2.1 it returns an object. So `st[:5]` no longer works, but `st.modified` works with both old and new versions of Mercurial. diff -r cc789a5baf4a -r e2d60e4e3caf prompt.py --- a/prompt.py Tue May 26 15:08:02 2020 +0200 +++ b/prompt.py Tue May 26 14:57:58 2020 +0200 @@ -279,9 +279,9 @@ def _status(m): g = m.groups() - st = repo.status(unknown=True)[:5] - modified = any(st[:4]) - unknown = len(st[-1]) > 0 + st = repo.status(unknown=True) + modified = any((st.modified, st.added, st.removed, st.deleted)) + unknown = len(st.unknown) > 0 flag = '' if '|modified' not in g and '|unknown' not in g: