Commit Graph

55 Commits

Author SHA1 Message Date
Martin Geisler
24f2c1af20 setup: backout 47cfa8aa4b94
We decided that it is better to let the distributions install these
files themselves since they know where to put them.
2009-12-10 22:26:09 +01:00
Dan Villiom Podlaski Christiansen
a6c07a0720 setup: install some useful data files.
The selection is somewhat arbitrary. In the case of the Zsh completion
file, it will not conflict with the builtin Zsh completions: they
are in a file named `_mercurial', not `_hg'.
2009-11-30 21:54:34 +01:00
Thomas Arendsen Hein
b795944ec3 Add missing bash_completion for qfinish 2009-11-12 12:46:00 +01:00
Mads Kiilerich
0f7110ec11 Merge with redone 9660769e6539 (issue1860) 2009-10-16 11:19:39 +02:00
Steve Losh
d8eb61a4f6 contrib/bash_completion: add tab completion for some bookmark commands 2009-09-17 22:30:45 -04:00
Kevin Bullock
7d9f94de98 bash_completion: add completions for shelve extension 2009-09-23 21:29:47 -05:00
Steve Losh
ffd2524669 Support branch names in contrib/bash_completion
Anywhere a revision is needed a branch name can be used to specify
the tip of that branch, so branch names should be tab completed.
2009-06-03 22:58:43 -04:00
Steve Losh
15b3451b67 Support merge in contrib/bash_completion 2009-06-03 22:54:53 -04:00
Jonas Diemer
e984394797 Fixed bash completion for filenames containing spaces. 2008-03-11 23:54:03 +01:00
Peter Arrenbrecht
bfb3ae9d06 Support qgoto in contrib/bash_completion. 2007-11-05 08:41:22 +01:00
Thomas Arendsen Hein
001b7980f8 Remove trailing spaces 2007-08-07 10:24:33 +02:00
Thomas Arendsen Hein
2cdb545f39 expanded bash_completion for transplant extension 2006-12-26 20:08:09 +01:00
Thomas Arendsen Hein
18cb6f7087 Yield entries from [paths], too, when completing -R/--repository. 2006-12-26 19:56:42 +01:00
Alexis S. L. Carvalho
e9f8074f12 bash_completion: qguard 2006-10-22 01:02:13 -03:00
Alexis S. L. Carvalho
6494ab9d9d bash_completion: allow overriding completion for arguments that start with "-" 2006-10-22 01:02:06 -03:00
Alexis S. L. Carvalho
48503f4580 bash_completion: qfold, qrename, qheader, qclone and qselect 2006-10-22 01:02:00 -03:00
Alexis S. L. Carvalho
8ae844fff4 bash_completion: email --bcc 2006-10-22 01:01:52 -03:00
Alexis S. L. Carvalho
648f8acf27 bash_completion: qdelete --rev 2006-10-22 01:01:45 -03:00
Alexis S. L. Carvalho
f8066a6345 bash_completion: make export fall back to tags when there's no mq patch applied 2006-10-22 01:01:42 -03:00
Alexis S. L. Carvalho
e6c66d1351 bash_completion: don't complete export with "garbage" when mq is not around
The "garbage" is the output of hg help printed when a command is not found.
2006-10-22 01:01:03 -03:00
Mathieu Clabaut ext:(%22)
465e0ef538 Improve bash_completion for patches in MQ 2006-07-26 20:15:31 +02:00
Alexis S. L. Carvalho
c5f6f508f5 bash_completion: completion for commands provided by extensions
Make the bash_completion function call _hg_cmd_$cmd to generate
completion candidates for $cmd if that function exists.

Add basic completion functions for:

- mq:
  - qpop
  - qpush
  - qdelete
  - qsave
  - qcommit
  - strip

- hbisect:
  - bisect

- patchbomb:
  - email

- gpg:
  - sign
2006-04-03 14:56:00 +02:00
Alexis S. L. Carvalho
bb83bf89db 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.
2006-04-02 18:20:52 +02:00
Thomas Arendsen Hein
7bd3e367e7 Make 'hg tags -q' only list tag names without revision numbers and hashes,
and change bash_completion to use this.
2006-04-01 23:57:24 +02:00
Alexis S. L. Carvalho
b5be2f0b92 add --options to debugcomplete and change bash_completion to use it
make debugcomplete print one item per line (this is not needed for the
bash_completion script, but should be easier to use in other scripts)
2006-04-01 22:50:12 +02:00
Thomas Arendsen Hein
0a049bc1ef Make bash_completion more robust for e.g. broken hgrc or old hg installations. 2006-03-12 12:29:03 +01:00
Benoit Boissinot
8c2989d646 new command debugcomplete
add a new command debugcomplete, it lists all the possible
completion for the specified command.
make the bash_completion script uses it instead of the awk code
2006-03-12 11:32:03 +01:00
Alexis S. L. Carvalho
9a000b91a7 Really fix bash_completion on Solaris. Maybe. Hopefully.
Use substr instead of sub.
2006-03-01 14:52:28 +01:00
Alexis S. L. Carvalho
6ba2866bba Fix bash_completion on Solaris
TK Soh noticed that the awk that ships with Solaris doesn't allow you
to define new functions.  According to
http://www.shelldorado.com/articles/awkcompat.html
it looks like it also doesn't have some other stuff that we were using,
like deletion of an array element and gsub.

Rewrite the parsing of hg --debug help to work around that. This
version doesn't filter aliases that are simple abbreviations for debug
commands (not a big problem, since there are none right now).
2006-02-28 11:49:35 -06:00
Thomas Arendsen Hein
df5b521a79 Cleanup of spacing in bash_completion 2006-02-02 08:16:17 +01:00
Thomas Arendsen Hein
d64ca73426 Use user specified path to hg in bash_completion
e.g. for multiple installs with different versions or extensions.
2006-02-02 07:50:20 +01:00
Alexis S. L. Carvalho
12832e1570 bash_completion: ignore hg help error messages
They are usually not useful when you're completing stuff and end up
cluttering the screen.
2006-01-27 12:15:39 +01:00
Alexis S. L. Carvalho
01b4cbf805 bash_completion: always use single quotes with compgen -W
This avoids a bug in bash 2.05a
2006-01-27 12:11:14 +01:00
Alexis S. L. Carvalho
af689bde09 bash_completion: be more careful about whitespaces
- use awk to parse the output of hg help.
- print one completion candidate per line
- print the debug commands after regular commands
  (this eases the shell side of the parsing)
- don't print aliases that are simple abbreviations
  (e.g. up/update, id/identify)
2006-01-27 12:10:35 +01:00
Thomas Arendsen Hein
2ac2a1e7e3 _hg_status improvements in bash_completion:
- Use "hg status -n" option instead of cut command.
- Sort status flags accoring to "hg status --help"
- Show deleted files instead of "hg remove"d for "hg remove"
2006-01-26 15:07:46 +01:00
Alexis S. L. Carvalho
606e1d0e53 bash_completion: small updates and fixes
- $result in _hg_commands is not an array
- use "hg status ."
- update "hg cat" completion
- let bash itself generate the default completion
2006-01-26 14:52:26 +01:00
Daniel Kobras
a3a420907c Less annoying directory completion (see http://bugs.debian.org/343458)
The current bash completion script is quite painful in conjuntion with
deep directory trees because it adds a space after each successful
directory completion. Eg. "hg clone /ho<tab>" is completed to "hg clone
/home " when what you really want is "hg clone /home/" (assuming the
complete path to the repository looks like /home/foo/hg...).

That's because the 'complete' command does not know about the type of
completion it receives from the _hg shell function. When only a single
completion is returned, it assumes completion is complete and tells
readline to add a trailing space. This behaviour is usually wanted, but
not in the case of directory completion.

I've attached a patch that circumvents this problem by only returning
successful completions for directories that contain a .hg subdirectory.
If no repositories are found, no completions are returned either, and
bash falls back to ordinary (filename) completion. I find this behaviour
a lot less annoying than the current one.

Alternative: Use option nospace for the 'complete' command and let _hg
itself take care of adding a trailing space where appropriate. That's a
far more intrusive change, though.
2005-12-15 15:40:14 +01:00
Thomas Arendsen Hein
f2525190a2 Space/Tab cleanup in bash_completion. 2005-11-23 08:07:27 +01:00
Alexis S. L. Carvalho
5bb8e5ebbc bash_completion: use hg --debug help to get the list of debug commands.
Also, try completing with the debug commands only when there's no other
candidates.

Based on an idea by TK Soh.
2005-11-23 08:02:35 +01:00
Vincent Danjean
0c1cbacb8a bash_completion is not an executable
Index: hg/contrib/bash_completion
===================================================================
--- hg.orig/contrib/bash_completion	2005-09-22 09:40:47.000000000 -0700
+++ hg/contrib/bash_completion	2005-09-23 18:32:46.000000000 -0700
@@ -1,5 +1,3 @@
-#!/bin/bash
-
 shopt -s extglob

 _hg_commands()
2005-09-23 18:58:48 -07:00
TK Soh
c5b7848e50 bash_completion: extended patterns require extglob option 2005-09-21 09:02:41 +02:00
Thomas Arendsen Hein
455a56454d Cleanup of tabs and trailing spaces. 2005-09-21 07:56:19 +02:00
Thomas Arendsen Hein
e72fd19edc Added new debug commands to bash_completion. 2005-09-16 21:31:31 +02:00
Alexis S. L. Carvalho
d3995fac64 bash_completion: try to use bash3 features if they're available
This does NOT break completion for bash 2.05b (I haven't tested
earlier versions)
2005-08-29 20:37:07 +02:00
Alexis S. L. Carvalho
d75704cfb1 bash_completion: small cleanup and bugfix
_hg_count_non_option wasn't taking global options into account
while counting non-option arguments.

It also used only its first argument.
2005-08-29 20:37:07 +02:00
Alexis S. L. Carvalho
098e537d63 teach bash_completion about --cwd 2005-08-29 20:37:07 +02:00
Alexis S. L. Carvalho
c499be626e bash_completion: better handling of aliases
Instead of listing every alias in the big case..esac, use hg help
to get the canonical name of the command.
2005-08-29 20:37:07 +02:00
Alexis S. L. Carvalho
a6928b8448 bash_completion: update for new help output format 2005-08-29 20:37:07 +02:00
mpm@selenic.com
e47546f442 bash_completion: add debugindex and debugdata support 2005-08-27 20:42:53 -07:00
mpm@selenic.com
49b9ae7f87 Add some aliases 2005-08-24 00:12:04 -07:00