# HG changeset patch # User Steve Losh # Date 1278455918 14400 # Node ID 645406a4e1fba1aa833a615855e5edb38c5568bf # Parent 43b7fb82d9a0c41ec8489c6763226778ab30e3dd Add the {queue} keyword. diff -r 43b7fb82d9a0 -r 645406a4e1fb docs/wiki/documentation/keywords/index.mdown --- a/docs/wiki/documentation/keywords/index.mdown Mon Jul 05 14:50:51 2010 -0400 +++ b/docs/wiki/documentation/keywords/index.mdown Tue Jul 06 18:38:38 2010 -0400 @@ -122,6 +122,9 @@ : Display STRING immediately after each unapplied patch. Useful for resetting color codes. +##queue## +: Display the name of the current MQ queue. + ##rev## : Display the repository-local changeset number of the current parent. diff -r 43b7fb82d9a0 -r 645406a4e1fb prompt.py --- a/prompt.py Mon Jul 05 14:50:51 2010 -0400 +++ b/prompt.py Tue Jul 06 18:38:38 2010 -0400 @@ -311,6 +311,23 @@ return '' return _r + def _queue(m): + g = m.groups() + + try: + extensions.find('mq') + except KeyError: + return '' + + q = repo.mq + + out = os.path.basename(q.path) + if out == 'patches' and not os.path.isdir(q.path): + out = '' + elif out.startswith('patches-'): + out = out[8:] + + return _with_groups(g, out) if out else '' if opts.get("angle_brackets"): tag_start = r'\<([^><]*?\<)?' @@ -346,6 +363,7 @@ '|(\|pre_unapplied\([^%s]*?\))' % brackets[-1] + '|(\|post_unapplied\([^%s]*?\))' % brackets[-1] + ')*': _patches, + 'queue': _queue, 'rev(\|merge)?': _rev, 'root': _root, 'root\|basename': _basename, @@ -522,6 +540,9 @@ Display STRING immediately after each unapplied patch. Useful for resetting color codes. +queue + Display the name of the current MQ queue. + rev Display the repository-local changeset number of the current parent.