Include window.h.
[bpt/emacs.git] / lisp / vc-cvs.el
index ec24282..94fd3d0 100644 (file)
@@ -1,6 +1,7 @@
 ;;; vc-cvs.el --- non-resident support for CVS version-control
 
-;; Copyright (C) 1995,98,99,2000,2001,02,2003  Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003,
+;;   2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Andre Spiegel <spiegel@gnu.org>
@@ -21,8 +22,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -235,16 +236,19 @@ See also variable `vc-cvs-sticky-date-format-string'."
 
 (defun vc-cvs-checkout-model (file)
   "CVS-specific version of `vc-checkout-model'."
-  (if (or (getenv "CVSREAD")
-          ;; If the file is not writable (despite CVSREAD being
-          ;; undefined), this is probably because the file is being
-          ;; "watched" by other developers.
-          ;; (If vc-mistrust-permissions was t, we actually shouldn't
-          ;; trust this, but there is no other way to learn this from CVS
-          ;; at the moment (version 1.9).)
-          (string-match "r-..-..-." (nth 8 (file-attributes file))))
+  (if (getenv "CVSREAD")
       'announce
-    'implicit))
+    (let ((attrib (file-attributes file)))
+      (if (and attrib ;; don't check further if FILE doesn't exist
+               ;; If the file is not writable (despite CVSREAD being
+               ;; undefined), this is probably because the file is being
+               ;; "watched" by other developers.
+               ;; (If vc-mistrust-permissions was t, we actually shouldn't
+               ;; trust this, but there is no other way to learn this from CVS
+               ;; at the moment (version 1.9).)
+               (string-match "r-..-..-." (nth 8 attrib)))
+          'announce
+        'implicit))))
 
 (defun vc-cvs-mode-line-string (file)
   "Return string for placement into the modeline for FILE.
@@ -448,7 +452,8 @@ REV is the revision to check out into WORKFILE."
        (message "Checking out %s...done" filename)))))
 
 (defun vc-cvs-delete-file (file)
-  (vc-cvs-command nil 0 file "remove" "-f"))
+  (vc-cvs-command nil 0 file "remove" "-f")
+  (vc-cvs-command nil 0 file "commit" "-mRemoved."))
 
 (defun vc-cvs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
@@ -745,7 +750,7 @@ is `local'.
 The default METHOD for a CVS root of the form
   [USER@]HOSTNAME:/path/to/repository
 is `ext'.
-For an empty string, nil is returned (illegal CVS root)."
+For an empty string, nil is returned (invalid CVS root)."
   ;; Split CVS root into colon separated fields (0-4).
   ;; The `x:' makes sure, that leading colons are not lost;
   ;; `HOST:/PATH' is then different from `:METHOD:/PATH'.