changeset 95825:85ee8c71ce8c

(vc-rcs-state-heuristic): Don't assume the file exists.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 11 Jun 2008 15:55:55 +0000
parents 27e773c9952b
children 54e76878a8c0
files lisp/ChangeLog lisp/vc-rcs.el
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Jun 11 06:00:36 2008 +0000
+++ b/lisp/ChangeLog	Wed Jun 11 15:55:55 2008 +0000
@@ -1,3 +1,7 @@
+2008-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc-rcs.el (vc-rcs-state-heuristic): Don't assume the file exists.
+
 2008-06-11  Glenn Morris  <rgm@gnu.org>
 
 	* progmodes/fortran.el (fortran-end-of-subprogram): Check for a match
--- a/lisp/vc-rcs.el	Wed Jun 11 06:00:36 2008 +0000
+++ b/lisp/vc-rcs.el	Wed Jun 11 15:55:55 2008 +0000
@@ -155,7 +155,8 @@
           ;; permissions can tell us whether locking is used for
           ;; the file or not.
           (if (and (eq state 'up-to-date)
-                   (not (vc-mistrust-permissions file)))
+                   (not (vc-mistrust-permissions file))
+                   (file-exists-p file))
               (cond
                ((string-match ".rw..-..-." (nth 8 (file-attributes file)))
                 (vc-file-setprop file 'vc-checkout-model 'implicit)
@@ -170,10 +171,10 @@
           (let* ((attributes  (file-attributes file 'string))
                  (owner-name  (nth 2 attributes))
                  (permissions (nth 8 attributes)))
-            (cond ((string-match ".r-..-..-." permissions)
+            (cond ((and permissions (string-match ".r-..-..-." permissions))
                    (vc-file-setprop file 'vc-checkout-model 'locking)
                    'up-to-date)
-                  ((string-match ".rw..-..-." permissions)
+                  ((and permissions (string-match ".rw..-..-." permissions))
 		   (if (eq (vc-rcs-checkout-model file) 'locking)
 		       (if (file-ownership-preserved-p file)
 			   'edited