zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] bzr completion: modified files
Date: Thu, 17 Apr 2014 21:58:13 +0200	[thread overview]
Message-ID: <53503255.7000301@gmail.com> (raw)
In-Reply-To: <53503126.3060209@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 275 bytes --]

On 04/17/2014 09:53 PM, Sebastien Alaiwan wrote:
> 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).
Sorry, here's instead a patch version with full path.

[-- Attachment #1.2: bzr_completion_modified_files.diff --]
[-- Type: text/plain, Size: 1117 bytes --]

diff --git a/Completion/Unix/Command/_bzr b/Completion/Unix/Command/_bzr
index ab9fd72..c28c214 100644
--- a/Completion/Unix/Command/_bzr
+++ b/Completion/Unix/Command/_bzr
@@ -46,6 +46,14 @@ _bzr_versionedFiles() {
     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 @@ case $cmd in
 	'--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 @@ case $cmd in
     args+=(
 	'--no-backup[skip generation of backup~ files]'
 	'(-r --revision)'{--revision=,-r}'[revision]:revision:'
-	'*:file:_bzr_versionedFiles'
+	'*:file:_bzr_modifiedFiles'
 	)
     ;;
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]

      reply	other threads:[~2014-04-17 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 19:53 Sebastien Alaiwan
2014-04-17 19:58 ` Sebastien Alaiwan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53503255.7000301@gmail.com \
    --to=sebastien.alaiwan@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).