Subject: bug#33295: closed (Re: bug#33295: Unhandled error in log-view-find-revision)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 07 Nov 2018 22:54:02 +0000

Your bug report

#33295: Unhandled error in log-view-find-revision

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
33295: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33295
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#33295: Unhandled error in log-view-find-revision
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Thu, 08 Nov 2018 00:42:42 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 27.1

> vc-find-backend-function: Cannot open load file: No such file or directory, vc-nil
>
> and with non-nil ‘debug-on-error’ shows a backtrace that refers to ‘require(vc-nil)’.
>
> This is because the value of ‘log-view-vc-fileset’ in that *vc-change-log* buffer
> is a directory.
>
> This patch changes it to display a nicer error:

Fixed.

Subject: Unhandled error in log-view-find-revision
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Tue, 06 Nov 2018 23:27:22 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

0. emacs -Q

1. in the root of a vc-controlled directory:

 C-x v L   ;; vc-print-root-log

2. on any revision

 f         ;; log-view-find-revision

fails with an error:
vc-find-backend-function: Cannot open load file: No such file or directory, vc-nil

and with non-nil ‘debug-on-error’ shows a backtrace that refers to ‘require(vc-nil)’.

This is because the value of ‘log-view-vc-fileset’ in that *vc-change-log* buffer
is a directory.

This patch changes it to display a nicer error:

diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index 6ff50dcde5..bfb31ccdab 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -517,8 +517,10 @@ log-view-find-revision
 If called interactively, visit the version at point."
   (interactive "d")
   (unless log-view-per-file-logs
-    (when (> (length log-view-vc-fileset) 1)
-      (error "Multiple files shown in this buffer, cannot use this command here")))
+    (when (or (> (length log-view-vc-fileset) 1)
+              (null (car log-view-vc-fileset))
+              (file-directory-p (car log-view-vc-fileset)))
+      (user-error "Multiple files shown in this buffer, cannot use this command here")))
   (save-excursion
     (goto-char pos)
     (switch-to-buffer (vc-find-revision (if log-view-per-file-logs
@@ -561,8 +563,10 @@ log-view-annotate-version
 If called interactively, annotate the version at point."
   (interactive "d")
   (unless log-view-per-file-logs
-    (when (> (length log-view-vc-fileset) 1)
-      (error "Multiple files shown in this buffer, cannot use this command here")))
+    (when (or (> (length log-view-vc-fileset) 1)
+              (null (car log-view-vc-fileset))
+              (file-directory-p (car log-view-vc-fileset)))
+      (user-error "Multiple files shown in this buffer, cannot use this command here")))
   (save-excursion
     (goto-char pos)
     (vc-annotate (if log-view-per-file-logs