# HG changeset patch
# User Steve Losh <steve@stevelosh.com>
# Date 1259109695 18000
# Node ID 0a2397ca666909cbff017ebcb18c879ef8b1f053
# Parent  13f545e329eb8a7eab23a00b00ffd3a7168068f1
Add the |reverse filter for patches.

diff -r 13f545e329eb -r 0a2397ca6669 prompt.py
--- a/prompt.py	Tue Nov 24 19:39:44 2009 -0500
+++ b/prompt.py	Tue Nov 24 19:41:35 2009 -0500
@@ -232,6 +232,9 @@
         
         patches = repo.mq.series
         
+        if _get_filter('reverse', g):
+            patches = reversed(patches)
+        
         return _with_groups(out_g, sep.join(patches)) if patches else ''
     
     def _root(m):
@@ -318,7 +321,7 @@
         'branch': _branch,
         'node(?:(\|short)|(\|merge))*': _node,
         'patch(?:(\|applied)|(\|unapplied)|(\|count))?': _patch,
-        'patches(?:(\|join\(.*?\)))*': _patches,
+        'patches(?:(\|join\(.*?\))|(\|reverse))*': _patches,
         'rev(\|merge)?': _rev,
         'root': _root,
         'root\|basename': _basename,