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.
bash_completion: simplify if-else logic
There is no change in functionality here but this makes refactoring this later
easier.
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.
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.
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
80f3ae36f908 to fix spaces in file names. In
this patch, we keep that behavior while also fixing subdirectory completion by
reverting
80f3ae36f908 and instead add backslashes to whitespace manually. This
approach means adding the completion option 'nospace' since we do this manually
now.
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).