[PATCH] mq: enable bash completion for qqueue

Yann E. MORIN yann.morin.1998 at anciens.enib.fr
Sun Aug 8 12:53:20 CDT 2010


Patrick, All,

On Sunday 08 August 2010 19:40:36 Patrick Mézard wrote:
> Wouldn't it be more reliable to call "qqueue -l" instead of listing
> directories looking like patch queues? In my weird case, I have old
> patch queues, created a long time ago with the mq merge facility, and
> not listed in the allqueues file. So they appear in the completion
> alternatives even if I cannot use them in the command. The only problem
> is "qqueue --list" adds an "(active)" suffix to the active queue.
> Perhaps we can avoid if --quiet or something like that?

At my first attempt, I did just that, but encountered the '(active)'
issue. So I looked at how other functions handeled that, and I saw that
_hg_ext_mq_queues() was using a similar construct to detect all queues.

I did not try to be smart, and just mimicked that behavior, just adapted
it to the context of qqueue.

Thinking a bit more, we do have the list of available mqueues in the
file .hg/patches.queues, so maybe we could simply 'cat' this file.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'


More information about the Mercurial-devel mailing list