Commit Graph

85 Commits

Author SHA1 Message Date
Sean Farley
f850db4e51 bash_completion: add -l|--list support for shelve
This was overlooked previously and found via 'hg shelve -p -l <tab>' (to show
the diff of the shelved commit).
2014-06-06 00:21:46 -05:00
Sean Farley
337aa76166 bash_completion: add global support for -b|--branch
Previously, only -r|--rev was parsed globally which meant 'hg push -b <tab>'
would try to complete a path instead of a branch.
2013-11-26 14:33:18 -06:00
Sean Farley
fa42f28d41 bash_completion: add global support for -B|--bookmark
Previously, only -r|--rev was parsed globally which meant 'hg push -B <tab>'
would try to complete a path instead of a bookmark.
2013-11-26 14:31:40 -06:00
Sean Farley
2c4a9fc383 bash_completion: change --rev if-else block into a case
Again, this doesn't change behavior but does make it easy to add cases in the
next patch.
2013-11-26 14:04:12 -06:00
Sean Farley
fdb3859999 bash_completion: simplify if-else logic
There is no change in functionality here but this makes refactoring this later
easier.
2013-11-26 13:55:33 -06:00
Sean Farley
dd1a68daaa bash_completion: add _hg_branches for list of branches 2013-11-25 11:38:14 -05:00
Sean Farley
894084345f bash_completion: add -B|--bookmark support for strip 2013-11-26 14:38:14 -06:00
Sean Farley
de5568a073 bash_completion: add completion for deleting a shelve 2013-11-22 14:58:41 -05:00
Sean Farley
f8159f9cef bash_completion: use correct command for listing shelves
Previously, _hg_shelves used the unshelve command to list current shelves. This
is actually the wrong command. The correct usage is 'hg shelve -l' so we use
that instead.
2013-11-21 15:14:52 -05:00
Sean Farley
e43c652608 bash_completion: remove restriction on bookmark completion
Previously, we only completed a bookmark when deleting or renaming a
bookmark. Since we can now move a bookmark forward, we drop this restriction.
2013-11-20 19:13:24 -05:00
Sean Farley
a3bd83dd26 bash_completion: fix issue with subdirectories not being completed
Previously, if there was a directory between the file and first-level directory (e.g. 'bar' in
foo/bar/file), then bash_completion would only list 'foo/file' instead of 'foo/bar/file'.

This behavior was introduced in ed00ea08afda to fix spaces in file names. In
this patch, we keep that behavior while also fixing subdirectory completion by
reverting ed00ea08afda and instead add backslashes to whitespace manually. This
approach means adding the completion option 'nospace' since we do this manually
now.
2013-11-20 14:45:18 -05:00
Sean Farley
46fae822f1 bash_completion: determine root executable in case of alias
This solves an issue for users that have "alias hg='hg --some_opts'" where they
would see wrong entries in the completion output (such as color codes).
2013-11-20 13:19:55 -05:00
Sean Farley
728e53206c bash_completion: expand aliased commands 2013-11-20 15:16:54 -05:00
Sean Farley
8ef12c7d6e bash_completion: untabify 2013-11-19 11:45:30 -05:00
Bryan O'Sullivan
408398cc48 bash_completion: recognize normal command abbreviations
In many common cases, this eliminates a call to "hg help" to get a
complete command name, thus improving responsiveness.
2013-03-21 21:07:22 -07:00
Bryan O'Sullivan
9d6e464bc6 completion: selectively use debugpathcomplete in bash_completion
The current bash_completion code can be very slow in a large working
directory. It always uses "hg status" to generate possibly matching
files, which checks the status of every file. We often don't care
about status when completing, so that cost is very high.

As the new debugpathcomplete command does not check the status of
files, it offers much better performance for commands that only
care about completing names.
2013-03-21 16:31:29 -07:00
Bryan O'Sullivan
59cec2d504 completion: add a debuglabelcomplete command
When completing a "label" (a symbolic name for a commit), the
bash_completion script currently has to invoke hg three times. For
a large repository, the cost of starting up and loading all the
necessary context over and over is very high.

For instance, in mozilla-central:

  time (export HGPLAIN=1; hg tags -q; hg bookmarks -q; hg branches) >/dev/null
  0.446 sec

Compare with the debuglabelcomplete command that this commit adds:

  time hg debuglabelcomplete >/dev/null
  0.148 sec

This greatly helps responsiveness.
2013-03-21 10:51:18 -07:00
Bryan O'Sullivan
c033affac4 bash_completion: nuke a duplicated function 2013-03-21 09:13:16 -07:00
Bryan O'Sullivan
21e58de02a bash_completion: tell an editor what type of file this is 2013-03-14 16:56:10 -07:00
Bryan O'Sullivan
dad0164132 bash_completion: allow remove to complete normal files
Previously, we only completed files that had already been manually
deleted. That behaviour made no sense. We now complete unmodified,
modified, and deleted files.
2013-03-14 16:50:53 -07:00
Bryan O'Sullivan
41a2d20ced bash_completion: match more narrowly
This greatly helps completion performance for most commands that deal
with files.

In a working dir with 150,000 files, where we want to complete the name
of a modified file under a path beginning with "a", from the root of
the working dir:

  (old) hg status -nm .            1.7 sec
  (new) hg status -nm "glob:a**"   0.3

Even "hg add" becomes a little faster, in spite of being the worst
case (matching untracked files).
2013-03-14 16:49:02 -07:00
Kevin Bullock
8b9c78e8cb bash_completion: add rebase rev completion 2012-08-31 13:17:16 -05:00
Jesus Espino Garcia
2574ec2be2 bash_completion: added -o filename option to _hg_status (issue3101) 2012-01-21 00:40:18 +01:00
Yann E. MORIN
e113e69fa1 bash_completion: enable alias auto-complete
When auto-completing, set HGPLAINEXCEPT=alias to list aliases
in the suggestions.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-17 00:46:52 +02:00
Thomas Arendsen Hein
6fa586d534 bash_completion: Use "hg paths -q" instead of piping through sed 2011-05-16 11:52:28 +02:00
Kevin Bullock
3a4f89086c bash_completion: complete bookmarks
Since bookmarks moved into core and are no longer merged with the list
of tags (8e2d23f4bd25), they don't get completed in bash_completion
along with other revision specifiers. This adds a new function to
provide the list of bookmarks for completion, and another, _hg_labels(),
to list all tags, branches, and bookmarks. It further modifies
completion for all commands where '_hg_tags; _hg_branches' was used to
use '_hg_labels' instead.
2011-02-28 16:45:15 -06:00
Patrick Mezard
da2f1496a7 bash_completion: support record command 2011-01-07 20:50:41 +01:00
Yann E. MORIN
f3a35cc478 mq/qqueue: update bash completion 2010-08-18 23:37:26 +02:00
Yann E. MORIN
af2d086089 mq/qqueue: enable bash completion
Return the list of available queues when completion is attempted on qqueue.
2010-08-08 23:10:08 +02:00
Brodie Rao
bfa13e8d9a bash/zsh completion: use HGPLAIN when invoking hg (issue2297) 2010-07-21 17:06:00 -04:00
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