# HG changeset patch # User Steve Losh # Date 1259110203 18000 # Node ID 89912d294ece147fc2898a60e9bf60075a6d13ee # Parent 0a2397ca666909cbff017ebcb18c879ef8b1f053 Add more patches filters, and reformat the regexes. diff -r 0a2397ca6669 -r 89912d294ece prompt.py --- a/prompt.py Tue Nov 24 19:41:35 2009 -0500 +++ b/prompt.py Tue Nov 24 19:50:03 2009 -0500 @@ -231,6 +231,13 @@ sep = join_filter_arg if join_filter else ' -> ' patches = repo.mq.series + applied = [p.name for p in repo.mq.applied] + unapplied = [p[1] for p in repo.mq.unapplied(repo)] + + if _get_filter('hide_applied', g): + patches = filter(lambda p: p not in applied, patches) + if _get_filter('hide_unapplied', g): + patches = filter(lambda p: p not in unapplied, patches) if _get_filter('reverse', g): patches = reversed(patches) @@ -319,16 +326,34 @@ patterns = { 'bookmark': _bookmark, 'branch': _branch, - 'node(?:(\|short)|(\|merge))*': _node, - 'patch(?:(\|applied)|(\|unapplied)|(\|count))?': _patch, - 'patches(?:(\|join\(.*?\))|(\|reverse))*': _patches, + 'node(?:' + '(\|short)' + '|(\|merge)' + ')*': _node, + 'patch(?:' + '(\|applied)' + '|(\|unapplied)' + '|(\|count)' + ')?': _patch, + 'patches(?:' + '(\|join\(.*?\))' + '|(\|reverse)' + '|(\|hide_applied)' + '|(\|hide_unapplied)' + ')*': _patches, 'rev(\|merge)?': _rev, 'root': _root, 'root\|basename': _basename, - 'status(?:(\|modified)|(\|unknown))*': _status, + 'status(?:' + '(\|modified)' + '|(\|unknown)' + ')*': _status, 'tags(\|[^}]*)?': _tags, 'task': _task, - 'tip(?:(\|node)|(\|short))*?': _tip, + 'tip(?:' + '(\|node)' + '|(\|short)' + ')*': _tip, 'update': _update, 'incoming(\|count)?': _remote('incoming'),