changeset 50899:6b9cefee3eee

(vc-mcvs-read): Don't require `file' to exist. (vc-mcvs-diff): Don't return 0 for newly added empty files.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 08 May 2003 18:25:09 +0000
parents 8806616471e2
children d853a98e1678
files lisp/vc-mcvs.el
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc-mcvs.el	Thu May 08 18:23:53 2003 +0000
+++ b/lisp/vc-mcvs.el	Thu May 08 18:25:09 2003 +0000
@@ -150,10 +150,11 @@
 	 root))))
 
 (defun vc-mcvs-read (file)
-  (with-temp-buffer
-    (insert-file-contents file)
-    (goto-char (point-min))
-    (read (current-buffer))))
+  (if (file-readable-p file)
+      (with-temp-buffer
+	(insert-file-contents file)
+	(goto-char (point-min))
+	(read (current-buffer)))))
 
 (defun vc-mcvs-map-file (dir file)
   (let ((map (vc-mcvs-read (expand-file-name "MCVS/MAP" dir)))
@@ -485,7 +486,9 @@
           ;; Note: this is NOT a "mcvs diff".
           (apply 'vc-do-command "*vc-diff*"
                  1 "diff" file
-                 (append diff-switches-list '("/dev/null"))))
+                 (append diff-switches-list '("/dev/null")))
+	  ;; Even if it's empty, it's locally modified.
+	  1)
       (setq status
             (apply 'vc-mcvs-command "*vc-diff*"
                    (if (and (vc-mcvs-stay-local-p file)