unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
To: 37182@debbugs.gnu.org
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	[thread overview]
Message-ID: <814aa9a9-c771-7637-6bfc-839f423eea22@gmx.de> (raw)

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	other threads:[~2019-08-25 17:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-25 17:54 Wolfgang Scherer [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=814aa9a9-c771-7637-6bfc-839f423eea22@gmx.de \
    --to=wolfgang.scherer@gmx.de \
    --cc=37182@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).