[PATCH] zsh: better fix for partial completions

Steve Borho steve at ageia.com
Tue Dec 12 21:40:56 UTC 2006


-- 
Steve Borho (steve at ageia.com)
http://www.borho.org/~steve/steveAgeia.asc
Key fingerprint = 3D9C 67D5 F426 4322 075B  0795 C9B2 C3A0 97D0 C090
-------------- next part --------------
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1165959251 21600
# Node ID 729f354f3f09eb3c6e976eeef17f5a2fa9cd30d1
# Parent  e88d03c2a3d95ae6865749e3686e1786e15a3505
zsh: better fix for partial completions

Properly handle relative paths followed by partial filenames
hg add ../path/to/file/partial[TAB]

diff -r e88d03c2a3d9 -r 729f354f3f09 contrib/zsh_completion
--- a/contrib/zsh_completion	Tue Dec 12 12:40:51 2006 -0800
+++ b/contrib/zsh_completion	Tue Dec 12 15:34:11 2006 -0600
@@ -178,6 +178,7 @@ _hg_files() {
 }
 
 _hg_status() {
+  [[ -d $PREFIX ]] || PREFIX=$PREFIX:h
   status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX 2>/dev/null)"})
 }
 


More information about the Mercurial-devel mailing list