all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#161: can't create new file if have RCS version
@ 2008-05-23 22:12 Stefan Monnier
  0 siblings, 0 replies; only message in thread
From: Stefan Monnier @ 2008-05-23 22:12 UTC (permalink / raw)
  To: 161

> It seems that vc-state can't handle a case where a file doens't exist
> but it is under version-control.

Does the patch below fix your problem?

> The function vc-state mentions new substates including removed;
> using that avoided the problem.

`removed' is used for something slightly different: it's when you've
told the VCS that the file should not be controlled by the VCS
any more.  What you describe would be more like `missing', I think, tho
I'm not sure about RCS's semantics.


        Stefan


--- vc-rcs.el.~1.77.~	2008-05-23 13:16:49.000000000 -0400
+++ vc-rcs.el	2008-05-23 18:10:07.000000000 -0400
@@ -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






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-23 22:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-23 22:12 bug#161: can't create new file if have RCS version Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.