mercurial/commands.py
changeset 18796 fa6d5c62f3bd
parent 18792 10669e24eb6c
child 18799 0ed95fe674a8
--- a/mercurial/commands.py	Thu Mar 21 21:20:40 2013 -0700
+++ b/mercurial/commands.py	Thu Mar 21 22:10:54 2013 -0700
@@ -2198,9 +2198,11 @@
         f, d = complete(spec, acceptable or 'nmar')
         files.update(f)
         dirs.update(d)
-    for d in dirs:
-        files.add(d + 'a')
-        files.add(d + 'b')
+    if not files and len(dirs) == 1:
+        # force the shell to consider a completion that matches one
+        # directory and zero files to be ambiguous
+        dirs.add(iter(dirs).next() + '.')
+    files.update(dirs)
     ui.write('\n'.join(repo.pathto(p, cwd) for p in sorted(files)))
     ui.write('\n')