Mercurial > hg
view tests/test-commit @ 2039:0c438fd25e6e
bash_completion: small optimization
Right now we always call "hg help $cmd" to get the canonical name of $cmd
(i.e. to go from "co" to "update").
This patch optimistically assumes that $cmd is already the canonical form
and tries to generate completions for it. If that fails, it falls back
to canonicalizing $cmd and trying again.
This means that:
- if a command or alias is explicitly handled by the
_hg_command_specific function, things get somewhat faster
- as long as the canonical $cmd is handled by _hg_command_specific, all
its aliases and abbreviations are also handled.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sun, 02 Apr 2006 18:20:52 +0200 |
parents | 7544700fd931 |
children | 38291d9c8c1c |
line wrap: on
line source
#!/bin/sh hg init test cd test echo foo > foo hg add foo hg commit -d '0 0' -m commit-1 echo foo >> foo hg commit -d '1 4444444' -m commit-3 hg commit -d '1 15.1' -m commit-4 hg commit -d 'foo bar' -m commit-5 hg commit -d ' 1 4444' -m commit-6 hg commit -d '111111111111 0' -m commit-7 echo bar > bar hg add bar rm bar hg commit -d "1000000 0" -m commit-8 2>&1 | sed -e "s:/.*\(/test/.*\):...\1:" exit 0