1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 21:51:40 +02:00

33221 (including 33173 from Anthony Heading): _perforce tweak.

Complete directories when handling unmaintained files for add.
Rationalise code and comments around this.
This commit is contained in:
Peter Stephenson 2014-09-23 12:38:46 +01:00
parent 8e83bdd288
commit 5378f6ad77
2 changed files with 15 additions and 5 deletions

View file

@ -1,5 +1,10 @@
2014-09-23 Peter Stephenson <p.stephenson@samsung.com>
* 33221 (including 33173 from Anthony Heading):
Completion/Unix/Command/_perforce: complete directories
when handling unmaintained files and rationalise code that does
this.
* unposted: Completion/Unix/Command/_dvi: add dvipdf to list of
commands.

View file

@ -1231,10 +1231,15 @@ _perforce_files() {
# "subdirs:subdirectory search:_perforce_subdirs"
)
_alternative $altfiles
elif [[ -n $unmaintained && -z $dodirs ]]; then
# a la _cvs_nonentried_files: directories are never maintained,
# so skip 'em. Unmaintained files can't be integrated, opened
# or resolved, so treat as exclusive (just as well, since
elif [[ -n $unmaintained ]]; then
# As directories are always umaintained, but may contain files
# we want to add, we'll always complete directories here. That's
# neater than the alternative of excluding them here and requesting
# them separately in the caller. The only client for this
# branch is currently 'p4 add'.
#
# Unmaintained files can't be integrated, opened
# or resolved, so treat as exclusive to other options (just as well, since
# this bit's messy).
local MATCH MBEGIN MEND
local -a omitpats
@ -1253,7 +1258,7 @@ _perforce_files() {
[[ $#omitpats -eq 1 && $omitpats[1] = '' ]] && omitpats=()
if (( ${#omitpats} )); then
_path_files -g "*~(*/|)(${(j:|:)~omitpats})(D.)"
_path_files -g "*~(*/|)(${(j:|:)~omitpats})(D)"
else
_path_files
fi