Function: vc-dir--fileset
vc-dir--fileset is a byte-compiled function defined in vc-dir.el.gz.
Signature
(vc-dir--fileset FILES ONLY-FILES-LIST)
Documentation
Call vc-only-files-state-and-model as appropriate for VC-Dir buffers.
Offer to call vc-dir-hide-up-to-date if that might be useful.
If we did, remove up-to-date items from FILES and ONLY-FILES-LIST before
passing the latter to vc-only-files-state-and-model. From FILES, only
remove items appearing literally: a directory named in FILES containing
up-to-date items won't be removed.
Return a list of the form returned by vc-deduce-fileset.
There's usually no action to be taken on up-to-date or ignored
files, but a new user may include these in their VC-Dir fileset without
realizing it. To avoid the user having to know in advance that what
they must do is invoke x (vc-dir-hide-up-to-date) before v (vc-next-action), offer to invoke vc-dir-hide-up-to-date
for them, and also filter ONLY-FILES-LIST so as not to include entries
in those states. Only do this if there are both up-to-date and
non-up-to-date files in ONLY-FILES-LIST (in case we add a VC next action
for up-to-date and/or ignored files at some point).
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-dir.el.gz
(defun vc-dir--fileset (files only-files-list)
"Call `vc-only-files-state-and-model' as appropriate for VC-Dir buffers.
Offer to call `vc-dir-hide-up-to-date' if that might be useful.
If we did, remove up-to-date items from FILES and ONLY-FILES-LIST before
passing the latter to `vc-only-files-state-and-model'. From FILES, only
remove items appearing literally: a directory named in FILES containing
up-to-date items won't be removed.
Return a list of the form returned by `vc-deduce-fileset'.
There's usually no action to be taken on `up-to-date' or `ignored'
files, but a new user may include these in their VC-Dir fileset without
realizing it. To avoid the user having to know in advance that what
they must do is invoke \\<vc-dir-mode-map>\\[vc-dir-hide-up-to-date] \
before \\[vc-next-action], offer to invoke `vc-dir-hide-up-to-date'
for them, and also filter ONLY-FILES-LIST so as not to include entries
in those states. Only do this if there are both up-to-date and
non-up-to-date files in ONLY-FILES-LIST (in case we add a VC next action
for `up-to-date' and/or `ignored' files at some point)."
;; We want to remove items explicitly named in FILES because some VCS
;; commands override files being ignored if they are named explicitly.
;; For example, 'hg commit -A foo' will commit foo even if foo is
;; ignored! By contrast, 'hg commit -A dir-containing-foo' won't, so
;; we don't need to worry about somehow removing dir-containing-foo
;; from FILES without otherwise changing the meaning of FILES.
(let (up-to-date other)
(dolist (entry only-files-list)
(push entry (if (memq (cdr entry) vc-dir--up-to-date-states)
up-to-date other)))
(cons vc-dir-backend
(if (or (null up-to-date) (null other)
(not (y-or-n-p "Clear up-to-date items before proceeding?")))
(cons files
(vc-only-files-state-and-model only-files-list
vc-dir-backend))
(vc-dir-hide-up-to-date)
(cons (cl-set-difference files (mapcar #'car up-to-date)
:test #'equal)
(vc-only-files-state-and-model other vc-dir-backend))))))