# HG changeset patch # User Steve Losh # Date 1254061305 14400 # Node ID b74891ea0325851711abec742caf100409e3be3b # Parent 5339b74840b12424cdf68efc7ba5982621c41cce Add modified and ignored filters to the status keyword. diff -r 5339b74840b1 -r b74891ea0325 prompt.py --- a/prompt.py Thu Sep 10 18:33:15 2009 -0400 +++ b/prompt.py Sun Sep 27 10:21:45 2009 -0400 @@ -114,9 +114,23 @@ return _with_groups(m.groups(), branch) if branch else '' def _status(m): + g = m.groups() + out_g = (g[0],) + (g[-1],) + st = repo.status(unknown=True)[:5] - flag = '!' if any(st[:4]) else '?' if st[-1] else '' - return _with_groups(m.groups(), flag) if flag else '' + modified = any(st[:4]) + unknown = len(st[-1]) > 0 + + flag = '' + if '|modified' not in g and '|unknown' not in g: + flag = '!' if modified else '?' if unknown else '' + else: + if '|modified' in g: + flag += '!' if modified else '' + if '|unknown' in g: + flag += '?' if unknown else '' + + return _with_groups(out_g, flag) if flag else '' def _bookmark(m): try: @@ -215,7 +229,7 @@ 'rev(\|merge)?': _rev, 'root': _root, 'root\|basename': _basename, - 'status': _status, + 'status(?:(\|modified)|(\|unknown))*': _status, 'tags(\|[^}]*)?': _tags, 'task': _task, 'update': _update,