aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-07-28 22:18:51 +0800
committerChong Yidong2012-07-28 22:18:51 +0800
commit1eee634131dea9cf32d6ab83a06c0776b680fe8e (patch)
tree868fda40fc3a02ede98b563e6203337bbfa531d3
parent69c3b839f881e2cd3d9b8c8cc78a4a25a4f7399c (diff)
downloademacs-1eee634131dea9cf32d6ab83a06c0776b680fe8e.tar.gz
emacs-1eee634131dea9cf32d6ab83a06c0776b680fe8e.zip
In C-x v L and C-x v D, prompt for directory if there is no default backend.
* lisp/vc/vc.el (vc-root-diff, vc-print-root-log): Prompt for a directory if vc-deduce-backend returns nil. Fixes: debbugs:7350
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/vc/vc.el22
2 files changed, 19 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d8e8575db89..f31218506ba 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -12,6 +12,9 @@
12 12
132012-07-28 Chong Yidong <cyd@gnu.org> 132012-07-28 Chong Yidong <cyd@gnu.org>
14 14
15 * vc/vc.el (vc-root-diff, vc-print-root-log): Prompt for a
16 directory if vc-deduce-backend returns nil (Bug#7350).
17
15 * simple.el (delete-trailing-lines): New option. 18 * simple.el (delete-trailing-lines): New option.
16 (delete-trailing-whitespace): Obey it (Bug#11879). 19 (delete-trailing-whitespace): Obey it (Bug#11879).
17 20
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 0f3298d2686..2d95b14244f 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1757,10 +1757,15 @@ saving the buffer."
1757 (call-interactively 'vc-version-diff) 1757 (call-interactively 'vc-version-diff)
1758 (when buffer-file-name (vc-buffer-sync not-urgent)) 1758 (when buffer-file-name (vc-buffer-sync not-urgent))
1759 (let ((backend (vc-deduce-backend)) 1759 (let ((backend (vc-deduce-backend))
1760 (default-directory default-directory)
1760 rootdir working-revision) 1761 rootdir working-revision)
1761 (unless backend 1762 (if backend
1762 (error "Buffer is not version controlled")) 1763 (setq rootdir (vc-call-backend backend 'root default-directory))
1763 (setq rootdir (vc-call-backend backend 'root default-directory)) 1764 (setq rootdir (read-directory-name "Directory for VC root-diff: "))
1765 (setq backend (vc-responsible-backend rootdir))
1766 (if backend
1767 (setq default-directory rootdir)
1768 (error "Directory is not version controlled")))
1764 (setq working-revision (vc-working-revision rootdir)) 1769 (setq working-revision (vc-working-revision rootdir))
1765 ;; VC diff for the root directory produces output that is 1770 ;; VC diff for the root directory produces output that is
1766 ;; relative to it. Bind default-directory to the root directory 1771 ;; relative to it. Bind default-directory to the root directory
@@ -2213,10 +2218,15 @@ When called interactively with a prefix argument, prompt for LIMIT."
2213 (t 2218 (t
2214 (list (when (> vc-log-show-limit 0) vc-log-show-limit))))) 2219 (list (when (> vc-log-show-limit 0) vc-log-show-limit)))))
2215 (let ((backend (vc-deduce-backend)) 2220 (let ((backend (vc-deduce-backend))
2221 (default-directory default-directory)
2216 rootdir working-revision) 2222 rootdir working-revision)
2217 (unless backend 2223 (if backend
2218 (error "Buffer is not version controlled")) 2224 (setq rootdir (vc-call-backend backend 'root default-directory))
2219 (setq rootdir (vc-call-backend backend 'root default-directory)) 2225 (setq rootdir (read-directory-name "Directory for VC root-log: "))
2226 (setq backend (vc-responsible-backend rootdir))
2227 (if backend
2228 (setq default-directory rootdir)
2229 (error "Directory is not version controlled")))
2220 (setq working-revision (vc-working-revision rootdir)) 2230 (setq working-revision (vc-working-revision rootdir))
2221 (vc-print-log-internal backend (list rootdir) working-revision nil limit))) 2231 (vc-print-log-internal backend (list rootdir) working-revision nil limit)))
2222 2232