Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] bzr completion: modified files



Hi there,

here's a patch allowing completing 'bzr commit' and 'bzr revert' with a list of versionned AND modified files (instead of a list of versionned files).

Cheers!

--- _bzr.back	2014-04-17 21:45:34.664671679 +0200
+++ _bzr	2014-04-17 21:47:51.863895257 +0200
@@ -46,6 +46,14 @@
     return 0
 }
 
+(( $+functions[_bzr_modifiedFiles] )) ||
+_bzr_modifiedFiles() {
+    local fileList
+    fileList=(${(ps:\0:)"$(bzr status . --versioned --short | cut -b 5- | tr '\n' '\0')"})
+    compadd -af fileList
+    return 0
+}
+
 (( $+functions[_bzr_completeParents] )) ||
 _bzr_completeParents() {
     local parentFile=$(bzr root 2>/dev/null)/.bzr/branch/parent
@@ -214,7 +222,7 @@
 	'--unchanged[include unchanged files]'
 	'(-q --quiet -v --verbose)'{--quiet,-q}'[be quiet]'
 	'(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]'
-	'*:modified files:_bzr_versionedFiles'
+	'*:modified files:_bzr_modifiedFiles'
 	)
     ;;
 
@@ -300,7 +308,7 @@
     args+=(
 	'--no-backup[skip generation of backup~ files]'
 	'(-r --revision)'{--revision=,-r}'[revision]:revision:'
-	'*:file:_bzr_versionedFiles'
+	'*:file:_bzr_modifiedFiles'
 	)
     ;;
 

Attachment: signature.asc
Description: OpenPGP digital signature



Messages sorted by: Reverse Date, Date, Thread, Author