From dann@godzilla.ics.uci.edu Thu Oct 8 13:21:44 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 8 Oct 2009 20:21:44 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.9 required=4.0 tests=AWL,MURPHY_DRUGS_REL8, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n98KLgsu025303 for ; Thu, 8 Oct 2009 13:21:43 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvzUc-0007Zv-36 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 16:21:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvzUW-0007UI-2a for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 16:21:40 -0400 Received: from [199.232.76.173] (port=36621 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvzUV-0007Tp-O6 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 16:21:35 -0400 Received: from paul-mcgann-v0.ics.uci.edu ([128.195.1.147]:45736) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MvzUV-000797-3o for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 16:21:35 -0400 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id n98KJxdL023555 for ; Thu, 8 Oct 2009 13:19:59 -0700 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n98KJxFW020300; Thu, 8 Oct 2009 13:19:59 -0700 (PDT) Date: Thu, 8 Oct 2009 13:19:59 -0700 (PDT) Message-Id: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> From: Dan Nicolaescu To: bug-gnu-emacs Subject: allow VC operations from dired X-Debbugs-No-Ack: yes Lines: 61 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: n98KJxdL023555 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) This patch allows VC operations to be run from dired. State changing VC operations are not supported. (only the various variations of log and diff) OK to check in? Index: vc.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v retrieving revision 1.732 diff -u -3 -p -r1.732 vc.el --- vc.el 3 Oct 2009 18:29:26 -0000 1.732 +++ vc.el 8 Oct 2009 20:17:08 -0000 @@ -634,7 +634,8 @@ (require 'vc-dispatcher) (eval-when-compile - (require 'cl)) + (require 'cl) + (require 'dired)) (unless (assoc 'vc-parent-buffer minor-mode-alist) (setq minor-mode-alist @@ -889,6 +903,10 @@ current buffer." (cond ((derived-mode-p 'vc-dir-mode) (vc-dir-deduce-fileset state-model-only-files)) + ((derived-mode-p 'dired-mode) + (if observer + (vc-dired-deduce-fileset) + (error "State changing VC operations not supported in `dired-mode'"))) ((setq backend (vc-backend buffer-file-name)) (if state-model-only-files (list backend (list buffer-file-name) @@ -921,4 +939,9 @@ + +(defun vc-dired-deduce-fileset () + (list (vc-responsible-backend default-directory) + (dired-map-over-marks (dired-get-filename nil t) nil))) + (defun vc-ensure-vc-buffer () "Make sure that the current buffer visits a version-controlled file." (cond @@ -1590,6 +1613,7 @@ saving the buffer." (when buffer-file-name (vc-buffer-sync not-urgent)) (let ((backend (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) + ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory)) (vc-mode (vc-backend buffer-file-name)))) rootdir working-revision) (unless backend @@ -1881,6 +1905,7 @@ If WORKING-REVISION is non-nil, leave th (interactive) (let ((backend (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) + ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory)) (vc-mode (vc-backend buffer-file-name)))) rootdir working-revision) (unless backend From juri@jurta.org Sun Oct 11 16:59:07 2009 Received: (at 4677) by emacsbugs.donarmstrong.com; 11 Oct 2009 23:59:07 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,URIBL_CNKR autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9BNx5Tr013480 for <4677@emacsbugs.donarmstrong.com>; Sun, 11 Oct 2009 16:59:06 -0700 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Received: from mail.starman.ee (82.131.52.99.cable.starman.ee [82.131.52.99]) by mx1.starman.ee (Postfix) with ESMTP id 05A0D3F40FF; Mon, 12 Oct 2009 02:58:56 +0300 (EEST) From: Juri Linkov To: Dan Nicolaescu Cc: 4677@debbugs.gnu.org Subject: Re: bug#4677: allow VC operations from dired Organization: JURTA References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> Date: Mon, 12 Oct 2009 02:55:36 +0300 In-Reply-To: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Thu, 8 Oct 2009 13:19:59 -0700 (PDT)") Message-ID: <87k4z1o58n.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > This patch allows VC operations to be run from dired. > State changing VC operations are not supported. > (only the various variations of log and diff) Thanks, it works right except in one case: when called outside of a repository controlled directory, it traverses all subdirectories trying to find a repository (I think traversing subdirectories makes no sense in this case) and later fails with: Wrong type argument: stringp, nil -- Juri Linkov http://www.jurta.org/emacs/ From dann@godzilla.ics.uci.edu Sun Oct 11 19:46:33 2009 Received: (at 4677) by emacsbugs.donarmstrong.com; 12 Oct 2009 02:46:33 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-6.4 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from colin-baker-v0.ics.uci.edu (colin-baker-v0.ics.uci.edu [128.195.1.153]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9C2kW0P011008 for <4677@emacsbugs.donarmstrong.com>; Sun, 11 Oct 2009 19:46:33 -0700 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by colin-baker-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id n9C2kO8B003510; Sun, 11 Oct 2009 19:46:24 -0700 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n9C2kOsV025230; Sun, 11 Oct 2009 19:46:24 -0700 (PDT) Date: Sun, 11 Oct 2009 19:46:24 -0700 (PDT) Message-Id: <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Juri Linkov Cc: 4677@debbugs.gnu.org Subject: Re: bug#4677: allow VC operations from dired References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> X-Debbugs-No-Ack: yes In-Reply-To: <87k4z1o58n.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 12 Oct 2009 02:55:36 +0300") Lines: 71 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: n9C2kO8B003510 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Juri Linkov writes: > > This patch allows VC operations to be run from dired. > > State changing VC operations are not supported. > > (only the various variations of log and diff) > > Thanks, it works right except in one case: when called outside of > a repository controlled directory, it traverses all subdirectories > trying to find a repository (I think traversing subdirectories > makes no sense in this case) and later fails with: > > Wrong type argument: stringp, nil Thanks. Here's an updated patch. Index: vc.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v retrieving revision 1.732 diff -u -3 -p -u -p -r1.732 vc.el --- vc.el 3 Oct 2009 18:29:26 -0000 1.732 +++ vc.el 12 Oct 2009 02:41:06 -0000 @@ -634,7 +631,8 @@ (require 'vc-dispatcher) (eval-when-compile - (require 'cl)) + (require 'cl) + (require 'dired)) (unless (assoc 'vc-parent-buffer minor-mode-alist) (setq minor-mode-alist @@ -889,6 +906,10 @@ current buffer." (cond ((derived-mode-p 'vc-dir-mode) (vc-dir-deduce-fileset state-model-only-files)) + ((derived-mode-p 'dired-mode) + (if observer + (vc-dired-deduce-fileset) + (error "State changing VC operations not supported in `dired-mode'"))) ((setq backend (vc-backend buffer-file-name)) (if state-model-only-files (list backend (list buffer-file-name) @@ -921,4 +942,11 @@ + +(defun vc-dired-deduce-fileset () + (let ((backend (vc-backend default-directory))) + (unless backend (error "Directory not under VC")) + (list backend + (dired-map-over-marks (dired-get-filename nil t) nil)))) + (defun vc-ensure-vc-buffer () "Make sure that the current buffer visits a version-controlled file." (cond @@ -1590,6 +1618,7 @@ saving the buffer." (when buffer-file-name (vc-buffer-sync not-urgent)) (let ((backend (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) + ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory)) (vc-mode (vc-backend buffer-file-name)))) rootdir working-revision) (unless backend @@ -1881,6 +1913,7 @@ If WORKING-REVISION is non-nil, leave th (interactive) (let ((backend (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) + ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory)) (vc-mode (vc-backend buffer-file-name)))) rootdir working-revision) (unless backend From juri@jurta.org Mon Oct 12 13:36:59 2009 Received: (at 4677) by emacsbugs.donarmstrong.com; 12 Oct 2009 20:37:00 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx2.starman.ee (smtp-out2.starman.ee [85.253.0.4]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9CKawbB009956 for <4677@emacsbugs.donarmstrong.com>; Mon, 12 Oct 2009 13:36:59 -0700 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Received: from mail.starman.ee (82.131.68.196.cable.starman.ee [82.131.68.196]) by mx2.starman.ee (Postfix) with ESMTP id B3E6D3F410D; Mon, 12 Oct 2009 23:36:52 +0300 (EEST) From: Juri Linkov To: Dan Nicolaescu Cc: 4677@debbugs.gnu.org Subject: Re: bug#4677: allow VC operations from dired Organization: JURTA References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> Date: Mon, 12 Oct 2009 23:27:09 +0300 In-Reply-To: <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Sun, 11 Oct 2009 19:46:24 -0700 (PDT)") Message-ID: <87vdiks99u.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > > > This patch allows VC operations to be run from dired. > > > State changing VC operations are not supported. > > > (only the various variations of log and diff) > > > > Thanks, it works right except in one case: when called outside of > > a repository controlled directory, it traverses all subdirectories > > trying to find a repository (I think traversing subdirectories > > makes no sense in this case) and later fails with: > > > > Wrong type argument: stringp, nil > > Thanks. Here's an updated patch. Hmm, now it fails with "Directory not under VC" in all directories even under version control since (vc-backend default-directory) always returns nil. -- Juri Linkov http://www.jurta.org/emacs/ From dann@godzilla.ics.uci.edu Mon Oct 12 13:51:45 2009 Received: (at 4677) by emacsbugs.donarmstrong.com; 12 Oct 2009 20:51:45 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-6.4 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from colin-baker-v0.ics.uci.edu (colin-baker-v0.ics.uci.edu [128.195.1.153]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9CKphgq012136 for <4677@emacsbugs.donarmstrong.com>; Mon, 12 Oct 2009 13:51:44 -0700 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by colin-baker-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id n9CKpXek018074; Mon, 12 Oct 2009 13:51:33 -0700 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n9CKpXKh003942; Mon, 12 Oct 2009 13:51:33 -0700 (PDT) Date: Mon, 12 Oct 2009 13:51:33 -0700 (PDT) Message-Id: <200910122051.n9CKpXKh003942@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Juri Linkov Cc: 4677@debbugs.gnu.org Subject: Re: bug#4677: allow VC operations from dired References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> <87vdiks99u.fsf@mail.jurta.org> X-Debbugs-No-Ack: yes In-Reply-To: <87vdiks99u.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 12 Oct 2009 23:27:09 +0300") Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: n9CKpXek018074 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Juri Linkov writes: > > > > This patch allows VC operations to be run from dired. > > > > State changing VC operations are not supported. > > > > (only the various variations of log and diff) > > > > > > Thanks, it works right except in one case: when called outside of > > > a repository controlled directory, it traverses all subdirectories > > > trying to find a repository (I think traversing subdirectories > > > makes no sense in this case) and later fails with: > > > > > > Wrong type argument: stringp, nil > > > > Thanks. Here's an updated patch. > > Hmm, now it fails with "Directory not under VC" in all directories > even under version control since (vc-backend default-directory) > always returns nil. Hmm, I should have said "not really tested". I guess the first version will have to do then. If people want to apply VC operations on non VC controlled directories it's too bad, they get an error. Unless someone else wants to work on giving a nicer error in that case... I don't really plan to do any further work on this, so if you want to adopt it and get it checked in, go right ahead. From juri@jurta.org Tue Oct 13 16:00:41 2009 Received: (at 4677) by emacsbugs.donarmstrong.com; 13 Oct 2009 23:00:41 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.3 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,URIBL_CNKR autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx2.starman.ee (smtp-out2.starman.ee [85.253.0.4]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9DN0dVI000675 for <4677@emacsbugs.donarmstrong.com>; Tue, 13 Oct 2009 16:00:40 -0700 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Received: from mail.starman.ee (82.131.28.50.cable.starman.ee [82.131.28.50]) by mx2.starman.ee (Postfix) with ESMTP id 95D263F40D9; Wed, 14 Oct 2009 02:00:32 +0300 (EEST) From: Juri Linkov To: Dan Nicolaescu Cc: 4677@debbugs.gnu.org Subject: Re: bug#4677: allow VC operations from dired Organization: JURTA References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> <87vdiks99u.fsf@mail.jurta.org> <200910122051.n9CKpXKh003942@godzilla.ics.uci.edu> Date: Wed, 14 Oct 2009 01:38:47 +0300 In-Reply-To: <200910122051.n9CKpXKh003942@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Mon, 12 Oct 2009 13:51:33 -0700 (PDT)") Message-ID: <87fx9mx640.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > > > > > This patch allows VC operations to be run from dired. > > > > > State changing VC operations are not supported. > > > > > (only the various variations of log and diff) > > > > > > > > Thanks, it works right except in one case: when called outside of > > > > a repository controlled directory, it traverses all subdirectories > > > > trying to find a repository (I think traversing subdirectories > > > > makes no sense in this case) and later fails with: > > > > > > > > Wrong type argument: stringp, nil > > > > > > Thanks. Here's an updated patch. > > > > Hmm, now it fails with "Directory not under VC" in all directories > > even under version control since (vc-backend default-directory) > > always returns nil. > > Hmm, I should have said "not really tested". > I guess the first version will have to do then. I see that (vc-backend default-directory) works for directories in CVS, but always returns nil for git (is it because git is file-oriented?). OTOH, (vc-call-backend 'git 'root default-directory) works for git, but (vc-call-backend 'cvs 'root default-directory) fails with "Sorry, root is not implemented for cvs" I can't find a generic function that would work for directories in all backends. -- Juri Linkov http://www.jurta.org/emacs/ From dann@godzilla.ics.uci.edu Tue Oct 13 16:22:45 2009 Received: (at 4677) by emacsbugs.donarmstrong.com; 13 Oct 2009 23:22:45 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-6.4 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from paul-mcgann-v0.ics.uci.edu (paul-mcgann-v0.ics.uci.edu [128.195.1.147]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9DNMiro004143 for <4677@emacsbugs.donarmstrong.com>; Tue, 13 Oct 2009 16:22:45 -0700 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id n9DNMPjw018383; Tue, 13 Oct 2009 16:22:25 -0700 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n9DNMPh0016298; Tue, 13 Oct 2009 16:22:25 -0700 (PDT) Date: Tue, 13 Oct 2009 16:22:25 -0700 (PDT) Message-Id: <200910132322.n9DNMPh0016298@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Juri Linkov Cc: 4677@debbugs.gnu.org Subject: Re: bug#4677: allow VC operations from dired References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> <87vdiks99u.fsf@mail.jurta.org> <200910122051.n9CKpXKh003942@godzilla.ics.uci.edu> <87fx9mx640.fsf@mail.jurta.org> X-Debbugs-No-Ack: yes In-Reply-To: <87fx9mx640.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 14 Oct 2009 01:38:47 +0300") Lines: 37 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: n9DNMPjw018383 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Juri Linkov writes: > > > > > > This patch allows VC operations to be run from dired. > > > > > > State changing VC operations are not supported. > > > > > > (only the various variations of log and diff) > > > > > > > > > > Thanks, it works right except in one case: when called outside of > > > > > a repository controlled directory, it traverses all subdirectories > > > > > trying to find a repository (I think traversing subdirectories > > > > > makes no sense in this case) and later fails with: > > > > > > > > > > Wrong type argument: stringp, nil > > > > > > > > Thanks. Here's an updated patch. > > > > > > Hmm, now it fails with "Directory not under VC" in all directories > > > even under version control since (vc-backend default-directory) > > > always returns nil. > > > > Hmm, I should have said "not really tested". > > I guess the first version will have to do then. > > I see that (vc-backend default-directory) works for directories in CVS, > but always returns nil for git (is it because git is file-oriented?). Nothing else uses (vc-backend DIRECTORY), so it's never been made reliable. > OTOH, (vc-call-backend 'git 'root default-directory) works for git, > but (vc-call-backend 'cvs 'root default-directory) fails with > > "Sorry, root is not implemented for cvs" > > I can't find a generic function that would work for directories > in all backends. There isn't any at the moment. From dann@godzilla.ics.uci.edu Fri Oct 23 11:21:17 2009 Received: (at 4677) by emacsbugs.donarmstrong.com; 23 Oct 2009 18:21:17 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-6.4 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from paul-mcgann-v0.ics.uci.edu (paul-mcgann-v0.ics.uci.edu [128.195.1.147]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9NILGa4006821 for <4677@emacsbugs.donarmstrong.com>; Fri, 23 Oct 2009 11:21:17 -0700 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id n9NIL7eL027134; Fri, 23 Oct 2009 11:21:07 -0700 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n9NIL7Qk000637; Fri, 23 Oct 2009 11:21:07 -0700 (PDT) Date: Fri, 23 Oct 2009 11:21:07 -0700 (PDT) Message-Id: <200910231821.n9NIL7Qk000637@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Juri Linkov Cc: 4677@debbugs.gnu.org Subject: Re: bug#4677: allow VC operations from dired References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> <87vdiks99u.fsf@mail.jurta.org> X-Debbugs-No-Ack: yes In-Reply-To: <87vdiks99u.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 12 Oct 2009 23:27:09 +0300") Lines: 21 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: n9NIL7eL027134 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Juri Linkov writes: > > > > This patch allows VC operations to be run from dired. > > > > State changing VC operations are not supported. > > > > (only the various variations of log and diff) > > > > > > Thanks, it works right except in one case: when called outside of > > > a repository controlled directory, it traverses all subdirectories > > > trying to find a repository (I think traversing subdirectories > > > makes no sense in this case) and later fails with: > > > > > > Wrong type argument: stringp, nil > > > > Thanks. Here's an updated patch. > > Hmm, now it fails with "Directory not under VC" in all directories > even under version control since (vc-backend default-directory) > always returns nil. The version that uses vc-responsible-backend should work correctly now (i.e. it will throw an error) when used in a non VC controlled directory. From dann@godzilla.ics.uci.edu Thu Nov 19 08:51:09 2009 Received: (at 4677) by emacsbugs.donarmstrong.com; 19 Nov 2009 16:51:10 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-6.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from paul-mcgann-v0.ics.uci.edu (paul-mcgann-v0.ics.uci.edu [128.195.1.147]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAJGp8wW018586 for <4677@emacsbugs.donarmstrong.com>; Thu, 19 Nov 2009 08:51:09 -0800 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nAJGouPt017087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Nov 2009 08:50:56 -0800 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nAJGotfn021379; Thu, 19 Nov 2009 08:50:55 -0800 (PST) Date: Thu, 19 Nov 2009 08:50:55 -0800 (PST) Message-Id: <200911191650.nAJGotfn021379@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Stefan Monnier Cc: 4677@debbugs.gnu.org, Juri Linkov Subject: Re: bug#4677: allow VC operations from dired References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> X-Debbugs-No-Ack: yes In-Reply-To: <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Sun, 11 Oct 2009 19:46:24 -0700 (PDT)") Lines: 76 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nAJGouPt017087 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Dan Nicolaescu writes: > Juri Linkov writes: > > > > This patch allows VC operations to be run from dired. > > > State changing VC operations are not supported. > > > (only the various variations of log and diff) > > > > Thanks, it works right except in one case: when called outside of > > a repository controlled directory, it traverses all subdirectories > > trying to find a repository (I think traversing subdirectories > > makes no sense in this case) and later fails with: > > > > Wrong type argument: stringp, nil > > Thanks. Here's an updated patch. Stefan, any reason not to install this patch (the up to date version of it)? > Index: vc.el > =================================================================== > RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v > retrieving revision 1.732 > diff -u -3 -p -u -p -r1.732 vc.el > --- vc.el 3 Oct 2009 18:29:26 -0000 1.732 > +++ vc.el 12 Oct 2009 02:41:06 -0000 > @@ -634,7 +631,8 @@ > (require 'vc-dispatcher) > > (eval-when-compile > - (require 'cl)) > + (require 'cl) > + (require 'dired)) > > (unless (assoc 'vc-parent-buffer minor-mode-alist) > (setq minor-mode-alist > @@ -889,6 +906,10 @@ current buffer." > (cond > ((derived-mode-p 'vc-dir-mode) > (vc-dir-deduce-fileset state-model-only-files)) > + ((derived-mode-p 'dired-mode) > + (if observer > + (vc-dired-deduce-fileset) > + (error "State changing VC operations not supported in `dired-mode'"))) > ((setq backend (vc-backend buffer-file-name)) > (if state-model-only-files > (list backend (list buffer-file-name) > @@ -921,4 +942,11 @@ > > + > +(defun vc-dired-deduce-fileset () > + (let ((backend (vc-backend default-directory))) > + (unless backend (error "Directory not under VC")) > + (list backend > + (dired-map-over-marks (dired-get-filename nil t) nil)))) > + > (defun vc-ensure-vc-buffer () > "Make sure that the current buffer visits a version-controlled file." > (cond > @@ -1590,6 +1618,7 @@ saving the buffer." > (when buffer-file-name (vc-buffer-sync not-urgent)) > (let ((backend > (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) > + ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory)) > (vc-mode (vc-backend buffer-file-name)))) > rootdir working-revision) > (unless backend > @@ -1881,6 +1913,7 @@ If WORKING-REVISION is non-nil, leave th > (interactive) > (let ((backend > (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) > + ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory)) > (vc-mode (vc-backend buffer-file-name)))) > rootdir working-revision) > (unless backend From monnier@IRO.UMontreal.CA Thu Nov 19 13:08:17 2009 Received: (at 4677) by emacsbugs.donarmstrong.com; 19 Nov 2009 21:08:17 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAJL8EWm014412 for <4677@emacsbugs.donarmstrong.com>; Thu, 19 Nov 2009 13:08:16 -0800 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nAJL8Djs000691; Thu, 19 Nov 2009 16:08:13 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 994433A0FA; Thu, 19 Nov 2009 16:08:13 -0500 (EST) From: Stefan Monnier To: Dan Nicolaescu Cc: 4677@debbugs.gnu.org, Juri Linkov Subject: Re: bug#4677: allow VC operations from dired Message-ID: References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> <200911191650.nAJGotfn021379@godzilla.ics.uci.edu> Date: Thu, 19 Nov 2009 16:08:13 -0500 In-Reply-To: <200911191650.nAJGotfn021379@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Thu, 19 Nov 2009 08:50:55 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3410=0 > Stefan, any reason not to install this patch (the up to date version of it)? Not that I know, Stefan From dann@godzilla.ics.uci.edu Fri Nov 20 08:37:20 2009 Received: (at 4677-done) by emacsbugs.donarmstrong.com; 20 Nov 2009 16:37:20 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-6.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from colin-baker-v0.ics.uci.edu (colin-baker-v0.ics.uci.edu [128.195.1.153]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAKGbJwa027681 for <4677-done@emacsbugs.donarmstrong.com>; Fri, 20 Nov 2009 08:37:20 -0800 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by colin-baker-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nAKGb9bx028056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Nov 2009 08:37:09 -0800 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nAKGb9go024620; Fri, 20 Nov 2009 08:37:09 -0800 (PST) Date: Fri, 20 Nov 2009 08:37:09 -0800 (PST) Message-Id: <200911201637.nAKGb9go024620@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Stefan Monnier Cc: 4677-done@debbugs.gnu.org Subject: Re: bug#4677: allow VC operations from dired References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> <200911191650.nAJGotfn021379@godzilla.ics.uci.edu> X-Debbugs-No-Ack: yes In-Reply-To: (Stefan Monnier's message of "Thu, 19 Nov 2009 16:08:13 -0500") Lines: 7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nAKGb9bx028056 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Stefan Monnier writes: > > Stefan, any reason not to install this patch (the up to date version of it)? > > Not that I know, Done. Thanks. From unknown Wed Jun 18 23:05:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 19 Dec 2009 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator