about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Magee <amagee@gmail.com>2014-06-04 17:03:41 +1000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2014-06-06 21:51:17 +0100
commit605cc1ba579ad6de619f1dca0f3d2857350a3c07 (patch)
tree44ab3a98fc0a5127a3883342d0377ca152fa5c8e
parent32756f78afc81bdc42b47c7bdb522c582b9d896a (diff)
downloadzsh-605cc1ba579ad6de619f1dca0f3d2857350a3c07.tar.gz
zsh-605cc1ba579ad6de619f1dca0f3d2857350a3c07.tar.xz
zsh-605cc1ba579ad6de619f1dca0f3d2857350a3c07.zip
19939: hg committable files
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_hg12
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 45066e8d2..2c44530d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-06  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* Andrew Magee: 32698: Completion/Unix/Command/_hg: show
+	committable files.
+
 2014-06-05  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* 32723: Src/glob.c: add braces around some if/else branches
diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg
index f48598278..c18500bcb 100644
--- a/Completion/Unix/Command/_hg
+++ b/Completion/Unix/Command/_hg
@@ -226,6 +226,16 @@ _hg_modified() {
   _wanted files expl 'modified files' _multi_parts / status_files
 }
 
+_hg_committable() {
+  typeset -a status_files
+  # A file is a candidate for `hg commit` if it is:
+  # - modified (m), or
+  # - added (a), or
+  # - removed (r)
+  _hg_status mar
+  _wanted files expl 'committable files' _multi_parts / status_files
+}
+
 _hg_resolve() {
   local rstate rpath
 
@@ -476,7 +486,7 @@ _hg_cmd_commit() {
   '(--logfile -l)'{-l+,--logfile}'[read commit message from specified file]:log file:_files' \
   '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
   '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
-  '*:file:_hg_files'
+  '*:file:_hg_committable'
 }
 
 _hg_cmd_copy() {