From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christoph Newsgroups: gmane.emacs.bugs Subject: bug#16254: 24.3.50; [PATCH] bzr error on emacs trunk using vc-print-log Date: Mon, 30 Dec 2013 08:53:39 -0700 Message-ID: References: <87d2kk4zcn.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e011827f6895d3d04eec27260 X-Trace: ger.gmane.org 1388418858 26441 80.91.229.3 (30 Dec 2013 15:54:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Dec 2013 15:54:18 +0000 (UTC) To: 16254@debbugs.gnu.org, Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 30 16:54:23 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VxfAY-0006rj-EY for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Dec 2013 16:54:18 +0100 Original-Received: from localhost ([::1]:58755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxfAY-0007Gd-4I for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Dec 2013 10:54:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxfAP-00077X-5l for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2013 10:54:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VxfAJ-0000wE-4y for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2013 10:54:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxfAJ-0000w8-0e for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2013 10:54:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VxfAI-0004JA-Ff for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2013 10:54:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87d2kk4zcn.fsf@gmail.com> Resent-From: Christoph Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Dec 2013 15:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16254 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16254-submit@debbugs.gnu.org id=B16254.138841882616530 (code B ref 16254); Mon, 30 Dec 2013 15:54:02 +0000 Original-Received: (at 16254) by debbugs.gnu.org; 30 Dec 2013 15:53:46 +0000 Original-Received: from localhost ([127.0.0.1]:52727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VxfA0-0004IX-CD for submit@debbugs.gnu.org; Mon, 30 Dec 2013 10:53:45 -0500 Original-Received: from mail-lb0-f182.google.com ([209.85.217.182]:45032) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vxf9w-0004IK-Uq for 16254@debbugs.gnu.org; Mon, 30 Dec 2013 10:53:42 -0500 Original-Received: by mail-lb0-f182.google.com with SMTP id l4so5530533lbv.41 for <16254@debbugs.gnu.org>; Mon, 30 Dec 2013 07:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=1LdFxvAU3VdKh/b5aqHqWBgjC5wb+6Lhany0dtuZ9gg=; b=fhKx4QRNw/jOmV/ES0ASN49zTFSZGv+kI1leSvvxI6KwRbCjS2yNhd6Osdtl6+iWP9 PVf3suLIGnDZu0ZgfASo0qYpiRmEGTt+Jw25AiBY9qzt6PbKO8LU1SCYtcM2m6YNRxCW 3M9Qtmeow70T32TnUNCBpmvWvjz8qtj98trlQ88mFjGTIkH85spzSlrfKitobIdM3H/d Z4ZfGnxRR5TDIo66i5DUiUfQEe0XqZEwJRq66N3vNo9k44rfX9NFQPoEz6EDafOewN4G sqr/q6hT47f07n4bXJnOmeHottxm35TcDkDRc+Vwcx1uxeU60sR7veXOaLgri7G5O0H3 VnLQ== X-Received: by 10.112.135.67 with SMTP id pq3mr1584284lbb.65.1388418819512; Mon, 30 Dec 2013 07:53:39 -0800 (PST) Original-Received: by 10.152.133.66 with HTTP; Mon, 30 Dec 2013 07:53:39 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82745 Archived-At: --089e011827f6895d3d04eec27260 Content-Type: text/plain; charset=ISO-8859-1 It would be nice if a fix for this issue made it into 24.4. Or do you think that this is too intrusive of a change? I'll add Changelog entries etc. and commit it if someone can look it over. Thanks. On Thu, Dec 26, 2013 at 7:47 PM, Christoph wrote: > This issue seems to be that when deducing the fileset in dired mode, the > code does not distinguish between files that are under version control and > files that aren't. > > The following patch adds detection (and filtering) of unregistered members > to vc-dired-deduce-fileset. > If the marked files have any unregistered files among them, the > unregistered files are filtered out. > If all files are unregistered, an error is shown. This also covers the > main case of selecting just one unregistered file/directory. > > Thoughts? > > === modified file 'lisp/vc/vc.el' > --- lisp/vc/vc.el 2013-11-26 19:17:55 +0000 > +++ lisp/vc/vc.el 2013-12-27 02:40:38 +0000 > @@ -1014,10 +1014,19 @@ > (t (error "File is not under version control"))))) > > (defun vc-dired-deduce-fileset () > - (let ((backend (vc-responsible-backend default-directory))) > - (unless backend (error "Directory not under VC")) > - (list backend > - (dired-map-over-marks (dired-get-filename nil t) nil)))) > + "Deduce a set of files and a backend to which to apply an > +operation from all the marked items in a dired buffer. Resulting > +fileset only includes items that are version controlled." > + (let ((backend (vc-responsible-backend default-directory)) > + (fileset > + (delq nil (mapcar > + (lambda (x) (if (not (equal (vc-backend x) nil)) x)) > + (dired-map-over-marks > + (dired-get-filename nil t) > + nil))))) > + (if (not fileset) > + (error "Marked fileset is not under version control") > + (list backend fileset)))) > > (defun vc-ensure-vc-buffer () > "Make sure that the current buffer visits a version-controlled file." > --089e011827f6895d3d04eec27260 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
It would be nice if a fix for this issue made it into 24.4= . Or do you think that this is too intrusive of a change?

I'll add Changelog entries etc. and commit it if someone can look it = over.

Thanks.

On Thu, Dec 26, 2013 at 7:47 PM, Christoph <= cschol2112@gmail.= com> wrote:
This issue seems to be that= when deducing the fileset in dired mode, the code does not distinguish bet= ween files that are under version control and files that aren't.

The following patch adds detection (and filtering) of unregi= stered members to vc-dired-deduce-fileset.
If the marked files have any unregistered files among them, the unregi= stered files are filtered out.=A0
If all files are unregistered, = an error is shown. This also covers the main case of selecting just one unr= egistered file/directory.

Thoughts?

=3D=3D=3D modif= ied file 'lisp/vc/vc.el'
--- lisp/vc/vc.el 2013-11-26 19:17:55 +0000
+++ lisp/= vc/vc.el 2013-12-27 02:40:38 +0= 000
@@ -1014,10 +1014,19 @@
=A0 =A0 =A0 (t (error "File is = not under version control")))))
=A0
=A0(defun vc-d= ired-deduce-fileset ()
- =A0(let ((backend (vc-responsible-backen= d default-directory)))
- =A0 =A0(unless backend (error "Directory not under VC"))
- =A0 =A0(list backend
- =A0 =A0 =A0 =A0 =A0(dired-map-o= ver-marks (dired-get-filename nil t) nil))))
+ =A0"Deduce a = set of files and a backend to which to apply an
+operation from all the marked items in a dired buffer. Resulting
+fileset only includes items that are version controlled."
=
+ =A0(let ((backend (vc-responsible-backend default-directory))
+ =A0 =A0 =A0 =A0(fileset
+ =A0 =A0 =A0 =A0 (delq nil (mapca= r
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(lambda (x) (if (not (= equal (vc-backend x) nil)) x))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0(dired-map-over-marks
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (dired-get-filename nil t)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nil)))))
+ =A0 =A0= (if (not fileset)
+ =A0 =A0 =A0 =A0(error "Marked fileset is= not under version control")
+ =A0 =A0 =A0(list backend file= set))))
=A0
=A0(defun vc-ensure-vc-buffer ()
=A0 =A0"Make sure that the current buffer visits a version-contro= lled file."
--089e011827f6895d3d04eec27260--