]> code.delx.au - gnu-emacs/commitdiff
In C-x v L and C-x v D, prompt for directory if there is no default backend.
authorChong Yidong <cyd@gnu.org>
Sat, 28 Jul 2012 14:18:51 +0000 (22:18 +0800)
committerChong Yidong <cyd@gnu.org>
Sat, 28 Jul 2012 14:18:51 +0000 (22:18 +0800)
* lisp/vc/vc.el (vc-root-diff, vc-print-root-log): Prompt for a
directory if vc-deduce-backend returns nil.

Fixes: debbugs:7350
lisp/ChangeLog
lisp/vc/vc.el

index d8e8575db8932ec3e273822b5ee4457d264cf4fb..f31218506baa87e694fc07cb09a0a86a1d193e2c 100644 (file)
@@ -12,6 +12,9 @@
 
 2012-07-28  Chong Yidong  <cyd@gnu.org>
 
+       * vc/vc.el (vc-root-diff, vc-print-root-log): Prompt for a
+       directory if vc-deduce-backend returns nil (Bug#7350).
+
        * simple.el (delete-trailing-lines): New option.
        (delete-trailing-whitespace): Obey it (Bug#11879).
 
index 0f3298d2686b1251066ee37e93138b92e17044e4..2d95b14244f81f26dc34235f42c36a0a4e5eb1aa 100644 (file)
@@ -1757,10 +1757,15 @@ saving the buffer."
       (call-interactively 'vc-version-diff)
     (when buffer-file-name (vc-buffer-sync not-urgent))
     (let ((backend (vc-deduce-backend))
+         (default-directory default-directory)
          rootdir working-revision)
-      (unless backend
-       (error "Buffer is not version controlled"))
-      (setq rootdir (vc-call-backend backend 'root default-directory))
+      (if backend
+         (setq rootdir (vc-call-backend backend 'root default-directory))
+       (setq rootdir (read-directory-name "Directory for VC root-diff: "))
+       (setq backend (vc-responsible-backend rootdir))
+       (if backend
+           (setq default-directory rootdir)
+         (error "Directory is not version controlled")))
       (setq working-revision (vc-working-revision rootdir))
       ;; VC diff for the root directory produces output that is
       ;; relative to it.  Bind default-directory to the root directory
@@ -2213,10 +2218,15 @@ When called interactively with a prefix argument, prompt for LIMIT."
     (t
      (list (when (> vc-log-show-limit 0) vc-log-show-limit)))))
   (let ((backend (vc-deduce-backend))
+       (default-directory default-directory)
        rootdir working-revision)
-    (unless backend
-      (error "Buffer is not version controlled"))
-    (setq rootdir (vc-call-backend backend 'root default-directory))
+    (if backend
+       (setq rootdir (vc-call-backend backend 'root default-directory))
+      (setq rootdir (read-directory-name "Directory for VC root-log: "))
+      (setq backend (vc-responsible-backend rootdir))
+      (if backend
+         (setq default-directory rootdir)
+       (error "Directory is not version controlled")))
     (setq working-revision (vc-working-revision rootdir))
     (vc-print-log-internal backend (list rootdir) working-revision nil limit)))