* [PATCH] Fix bzr completion
@ 2014-02-22 19:26 Sebastien Alaiwan
0 siblings, 0 replies; only message in thread
From: Sebastien Alaiwan @ 2014-02-22 19:26 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1.1: Type: text/plain, Size: 742 bytes --]
Hi,
here's a small patch that fixes bzr completion when trying to complete a filename not directly in the current directory.
Let's say I'm in the root directory of a bazaar checkout.
I modify the following files:
"README.txt"
"src/file.cpp"
bzr commit READ<hit tab>
bzr commit README.txt
Completion works for this file, because it sits at root level.
bzr commit src/fi<hit tab>
No matches for: `modified files'
Which is clearly not the expected result. The attached patch fixes this by passing "-R" (recurse) option to bzr when computing the list of versionned files.
Same thing for unknown files (used when completing "bzr add " commands).
Best regards and many thanks for the great shell,
Sebastien Alaiwan
[-- Attachment #1.2: zsh_bzr_completion_fix.diff --]
[-- Type: text/plain, Size: 764 bytes --]
diff --git a/Completion/Unix/Command/_bzr b/Completion/Unix/Command/_bzr
index 23feb6f..ab9fd72 100644
--- a/Completion/Unix/Command/_bzr
+++ b/Completion/Unix/Command/_bzr
@@ -25,7 +25,7 @@ curcontext="${curcontext%:*:*}:bzr-$cmd:"
(( $+functions[_bzr_unknownFiles] )) ||
_bzr_unknownFiles() {
local fileList
- fileList=(${(ps:\0:)"$(bzr ls --null --unknown)"})
+ fileList=(${(ps:\0:)"$(bzr ls --null --unknown -R)"})
compadd -af fileList
return 0
}
@@ -41,7 +41,7 @@ _bzr_unknownRoot() {
(( $+functions[_bzr_versionedFiles] )) ||
_bzr_versionedFiles() {
local fileList
- fileList=(${(ps:\0:)"$(bzr ls --null --versioned)"})
+ fileList=(${(ps:\0:)"$(bzr ls --null --versioned -R)"})
compadd -af fileList
return 0
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-02-22 19:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-22 19:26 [PATCH] Fix bzr completion Sebastien Alaiwan
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).