unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37182: 24.5; 24.5.1: C-u vc-dir-mark-all-files should not mark directories
@ 2019-08-25 17:54 Wolfgang Scherer
       [not found] ` <handler.37182.B.156675851429203.ack@debbugs.gnu.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Scherer @ 2019-08-25 17:54 UTC (permalink / raw)
  To: 37182

In a *vc-dir* buffer of a mercurial or git repository, it appears to be
the intention, that marking both a directory and files inside the
directory is invalid.

1. When a directory is marked,

   - trying to mark a file in the directory raises the error:

       vc-dir-mark-file: Parent directory `./' is already marked

   - trying to mark all files with `C-u M' raises the error:

       Cannot mark all files, directory `./' marked

2. When a file is marked,

   - trying to mark the parent directory raises the error:

       vc-dir-mark-file: File `xx' in this directory is already marked

3. However, when no directories are marked,

   - marking all files with the key sequence `C-u M', results in all
     directories and all files to be marked

   - trying to mark all files again with `C-u M' raises the error:

       Cannot mark all files, directory `./' marked

This behavior is inconsistent.

The following patch against the savannah repository fixes it:

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 9a6f6bb..567da65 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -667,7 +667,8 @@ share the same state."
      vc-ewoc)
     (ewoc-map
      (lambda (filearg)
-       (unless (vc-dir-fileinfo->marked filearg)
+       (unless (or (vc-dir-fileinfo->directory filearg)
+               (vc-dir-fileinfo->marked filearg))
          (setf (vc-dir-fileinfo->marked filearg) t)
          t))
      vc-ewoc))






^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-11 22:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-25 17:54 bug#37182: 24.5; 24.5.1: C-u vc-dir-mark-all-files should not mark directories Wolfgang Scherer
     [not found] ` <handler.37182.B.156675851429203.ack@debbugs.gnu.org>
2019-08-26 23:06   ` bug#37182: Acknowledgement (24.5; 24.5.1: C-u vc-dir-mark-all-files should not mark directories) Wolfgang Scherer
2020-02-05  0:28     ` Dmitry Gutov
2020-02-05 14:24       ` Eli Zaretskii
2020-02-11 22:31         ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).