* bug#4677: allow VC operations from dired @ 2009-10-08 20:19 ` Dan Nicolaescu 2009-10-11 23:55 ` Juri Linkov 2009-11-20 16:45 ` bug#4677: marked as done (allow VC operations from dired) Emacs bug Tracking System 0 siblings, 2 replies; 11+ messages in thread From: Dan Nicolaescu @ 2009-10-08 20:19 UTC (permalink / raw) To: bug-gnu-emacs 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: allow VC operations from dired 2009-10-08 20:19 ` bug#4677: allow VC operations from dired Dan Nicolaescu @ 2009-10-11 23:55 ` Juri Linkov 2009-10-12 2:46 ` Dan Nicolaescu 2009-11-20 16:45 ` bug#4677: marked as done (allow VC operations from dired) Emacs bug Tracking System 1 sibling, 1 reply; 11+ messages in thread From: Juri Linkov @ 2009-10-11 23:55 UTC (permalink / raw) To: Dan Nicolaescu; +Cc: 4677 > 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/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: allow VC operations from dired 2009-10-11 23:55 ` Juri Linkov @ 2009-10-12 2:46 ` Dan Nicolaescu 2009-10-12 20:27 ` Juri Linkov 2009-11-19 16:50 ` Dan Nicolaescu 0 siblings, 2 replies; 11+ messages in thread From: Dan Nicolaescu @ 2009-10-12 2:46 UTC (permalink / raw) To: Juri Linkov; +Cc: 4677 Juri Linkov <juri@jurta.org> 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: allow VC operations from dired 2009-10-12 2:46 ` Dan Nicolaescu @ 2009-10-12 20:27 ` Juri Linkov 2009-10-12 20:51 ` Dan Nicolaescu 2009-10-23 18:21 ` Dan Nicolaescu 2009-11-19 16:50 ` Dan Nicolaescu 1 sibling, 2 replies; 11+ messages in thread From: Juri Linkov @ 2009-10-12 20:27 UTC (permalink / raw) To: Dan Nicolaescu; +Cc: 4677 > > > 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/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: allow VC operations from dired 2009-10-12 20:27 ` Juri Linkov @ 2009-10-12 20:51 ` Dan Nicolaescu 2009-10-13 22:38 ` Juri Linkov 2009-10-23 18:21 ` Dan Nicolaescu 1 sibling, 1 reply; 11+ messages in thread From: Dan Nicolaescu @ 2009-10-12 20:51 UTC (permalink / raw) To: Juri Linkov; +Cc: 4677 Juri Linkov <juri@jurta.org> 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. ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: allow VC operations from dired 2009-10-12 20:51 ` Dan Nicolaescu @ 2009-10-13 22:38 ` Juri Linkov 2009-10-13 23:22 ` Dan Nicolaescu 0 siblings, 1 reply; 11+ messages in thread From: Juri Linkov @ 2009-10-13 22:38 UTC (permalink / raw) To: Dan Nicolaescu; +Cc: 4677 > > > > > 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/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: allow VC operations from dired 2009-10-13 22:38 ` Juri Linkov @ 2009-10-13 23:22 ` Dan Nicolaescu 0 siblings, 0 replies; 11+ messages in thread From: Dan Nicolaescu @ 2009-10-13 23:22 UTC (permalink / raw) To: Juri Linkov; +Cc: 4677 Juri Linkov <juri@jurta.org> 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. ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: allow VC operations from dired 2009-10-12 20:27 ` Juri Linkov 2009-10-12 20:51 ` Dan Nicolaescu @ 2009-10-23 18:21 ` Dan Nicolaescu 1 sibling, 0 replies; 11+ messages in thread From: Dan Nicolaescu @ 2009-10-23 18:21 UTC (permalink / raw) To: Juri Linkov; +Cc: 4677 Juri Linkov <juri@jurta.org> 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. ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: allow VC operations from dired 2009-10-12 2:46 ` Dan Nicolaescu 2009-10-12 20:27 ` Juri Linkov @ 2009-11-19 16:50 ` Dan Nicolaescu 2009-11-19 21:08 ` Stefan Monnier 1 sibling, 1 reply; 11+ messages in thread From: Dan Nicolaescu @ 2009-11-19 16:50 UTC (permalink / raw) To: Stefan Monnier; +Cc: 4677 Dan Nicolaescu <dann@ics.uci.edu> writes: > Juri Linkov <juri@jurta.org> 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: allow VC operations from dired 2009-11-19 16:50 ` Dan Nicolaescu @ 2009-11-19 21:08 ` Stefan Monnier 0 siblings, 0 replies; 11+ messages in thread From: Stefan Monnier @ 2009-11-19 21:08 UTC (permalink / raw) To: Dan Nicolaescu; +Cc: 4677 > Stefan, any reason not to install this patch (the up to date version of it)? Not that I know, Stefan ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#4677: marked as done (allow VC operations from dired) 2009-10-08 20:19 ` bug#4677: allow VC operations from dired Dan Nicolaescu 2009-10-11 23:55 ` Juri Linkov @ 2009-11-20 16:45 ` Emacs bug Tracking System 1 sibling, 0 replies; 11+ messages in thread From: Emacs bug Tracking System @ 2009-11-20 16:45 UTC (permalink / raw) To: Dan Nicolaescu [-- Attachment #1: Type: text/plain, Size: 882 bytes --] Your message dated Fri, 20 Nov 2009 08:37:09 -0800 (PST) with message-id <200911201637.nAKGb9go024620@godzilla.ics.uci.edu> and subject line Re: bug#4677: allow VC operations from dired has caused the Emacs bug report #4677, regarding allow VC operations from dired to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) -- 4677: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4677 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems [-- Attachment #2: Type: message/rfc822, Size: 4563 bytes --] From: Dan Nicolaescu <dann@ics.uci.edu> To: bug-gnu-emacs <bug-gnu-emacs@gnu.org> Subject: allow VC operations from dired Date: Thu, 8 Oct 2009 13:19:59 -0700 (PDT) Message-ID: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> 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 [-- Attachment #3: Type: message/rfc822, Size: 2382 bytes --] From: Dan Nicolaescu <dann@ics.uci.edu> To: Stefan Monnier <monnier@IRO.UMontreal.CA> Cc: 4677-done@emacsbugs.donarmstrong.com Subject: Re: bug#4677: allow VC operations from dired Date: Fri, 20 Nov 2009 08:37:09 -0800 (PST) Message-ID: <200911201637.nAKGb9go024620@godzilla.ics.uci.edu> Stefan Monnier <monnier@IRO.UMontreal.CA> writes: > > Stefan, any reason not to install this patch (the up to date version of it)? > > Not that I know, Done. Thanks. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-11-20 16:45 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <200911201637.nAKGb9go024620@godzilla.ics.uci.edu> 2009-10-08 20:19 ` bug#4677: allow VC operations from dired Dan Nicolaescu 2009-10-11 23:55 ` Juri Linkov 2009-10-12 2:46 ` Dan Nicolaescu 2009-10-12 20:27 ` Juri Linkov 2009-10-12 20:51 ` Dan Nicolaescu 2009-10-13 22:38 ` Juri Linkov 2009-10-13 23:22 ` Dan Nicolaescu 2009-10-23 18:21 ` Dan Nicolaescu 2009-11-19 16:50 ` Dan Nicolaescu 2009-11-19 21:08 ` Stefan Monnier 2009-11-20 16:45 ` bug#4677: marked as done (allow VC operations from dired) Emacs bug Tracking System
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.