Commit 8de724f3 authored by Dan Nicolaescu's avatar Dan Nicolaescu
Browse files

(vc-deduce-fileset): Allow non-state changing operations

from a dired buffer.
(vc-dired-deduce-fileset): New function.
(vc-root-diff, vc-print-root-log): Use it.
parent 7a2efa6f
......@@ -230,6 +230,8 @@ advantage of this feature.
*** When a file is not found, VC will not try to check it out of RCS anymore.
*** Diff and log operations can be used from dired buffers.
*** vc-git changes
**** The new variable vc-git-add-signoff can be used to add a
......
2009-11-20 Dan Nicolaescu <dann@ics.uci.edu>
* vc.el (vc-deduce-fileset): Allow non-state changing operations
from a dired buffer.
(vc-dired-deduce-fileset): New function.
(vc-root-diff, vc-print-root-log): Use it.
* vc-annotate.el (vc-annotate-show-log-revision-at-line): Pass a
nil LIMIT argument to vc-print-log-internal.
......
......@@ -617,7 +617,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
......@@ -902,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)
......@@ -930,6 +935,12 @@ current buffer."
(list buffer-file-name))))
(t (error "No fileset is available here")))))
(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))))
(defun vc-ensure-vc-buffer ()
"Make sure that the current buffer visits a version-controlled file."
(cond
......@@ -1601,6 +1612,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
......@@ -1937,6 +1949,7 @@ If WORKING-REVISION is non-nil, leave the point at that revision."
(list nil))))
(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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment