# HG changeset patch # User Steve Losh # Date 1294883242 18000 # Node ID 065e9fbdd64d548f8bfeb7351554e702e3927586 # Parent 2817cac5f5d77ff70cb2649911ac1647149fcc43 Add the topindex keyword from Justin Lebar. diff -r 2817cac5f5d7 -r 065e9fbdd64d prompt.py --- a/prompt.py Tue Jul 06 18:41:51 2010 -0400 +++ b/prompt.py Wed Jan 12 20:47:22 2011 -0500 @@ -157,7 +157,12 @@ if _get_filter('quiet', g) and not len(q.series): return '' - if _get_filter('applied', g): + if _get_filter('topindex', g): + if len(q.applied): + out = str(len(q.applied) - 1) + else: + out = '' + elif _get_filter('applied', g): out = str(len(q.applied)) elif _get_filter('unapplied', g): out = str(len(q.unapplied(repo))) @@ -349,7 +354,8 @@ '|(\|merge)' ')*': _node, 'patch(?:' - '(\|applied)' + '(\|topindex)' + '|(\|applied)' '|(\|unapplied)' '|(\|count)' '|(\|quiet)' @@ -496,6 +502,11 @@ |count Display the number of patches in the queue. + |topindex + Display (zero-based) index of the topmost applied patch in the series + list (as displayed by :hg:`qtop -v`, or the empty string if no patch + is applied. + |applied Display the number of currently applied patches in the queue.