bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37182: 24.5; 24.5.1: C-u vc-dir-mark-all-files should not mark direc


From: Wolfgang Scherer
Subject: bug#37182: 24.5; 24.5.1: C-u vc-dir-mark-all-files should not mark directories
Date: Sun, 25 Aug 2019 19:54:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

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))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]