bash-completition wrong escapes special characters for mercurial

Bug #460239 reported by kol
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: bash-completion

When I do
# hg add Ann<TAB>
I get
# hg add Annex A.txt

Should be:
# hg add Annex\ A.txt

But! If I have file in the same directory, which name has same first letters, everything is OK.
E.g.:
# ls Ann*
Annex A.txt
Annex B.txt
# hg add Ann<TAB>
I get
# hg add Annex\

So, completition doesn't escape spaces (and other characters like '&') for mercurial when there is only one possibility for completition. When there are several choices all is OK.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia wl
Package: bash-completion 20080705ubuntu3
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=uk_UA.UTF-8
 SHELL=/bin/bash
SourcePackage: bash-completion
Uname: Linux 2.6.28-15-generic i686

Revision history for this message
kol (kol-cv) wrote :
Revision history for this message
Adrianna Pińska (confluence) wrote :

My mercurial tab completion is also messed up, but not in quite the same way. Some commands, like 'hg log ...' are fine. 'hg add ...' has problems: if I have one possibility, I get the filename with unescaped spaces. If I have multiple possibilities, it *doesn't* work correctly for me. The first time I press tab I get the common prefix, and what happens next depends on whether the common prefix contains a space. If it contains a space, weird things happen when I press tab more times because once the prefix has been echoed everything after the space is considered to be a new filename.

I'm pretty sure this is a problem in Natty's bash completion rather than Mercurial's bash completion file -- I have tried two new versions (1.9.0 and 1.9.1) from PPAs, and the 1.9.0 PPA version was working correctly in Lucid and in Maverick.

If I don't source /etc/bash_completion in .bashrc, I get saner behaviour with mercurial, but as far as I understand that's turning off all the custom bash completion entirely, and I no longer have useful functionality like 'hg add ...' only completing files not already under version control, and so on.

Changed in bash-completion (Ubuntu):
status: New → Confirmed
Revision history for this message
Peter Cordes (peter-cordes) wrote :

OPs testcase works now. Even did hg init in my tmp dir, to test that it was filtering hg add to only show not-already-added paths. Reopen this if you can still reproduce, and give us a testcase. (touch / mkdir some stuff, hg init, and say what you typed and where you pressed tab)

Changed in bash-completion (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.