]> code.delx.au - gnu-emacs/blobdiff - lisp/vc-rcs.el
Sung has assignment.
[gnu-emacs] / lisp / vc-rcs.el
index 14a091c4a6f15285bef6dbf45d6890b78cbce7b2..31ec90f586e7fce4c6f6f7f4b7cbca8655d430bc 100644 (file)
@@ -155,7 +155,8 @@ For a description of possible values, see `vc-check-master-templates'."
           ;; 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 @@ For a description of possible values, see `vc-check-master-templates'."
           (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
@@ -405,7 +406,7 @@ whether to remove it."
         (vc-switches 'RCS 'checkout)))
 
 (defun vc-rcs-checkout (file &optional editable rev)
-  "Retrieve a copy of a saved version of FILE. If FILE is a directory, 
+  "Retrieve a copy of a saved version of FILE.  If FILE is a directory,
 attempt the checkout for all registered files beneath it."
   (if (file-directory-p file)
       (mapc 'vc-rcs-checkout (vc-expand-dirs (list file)))
@@ -471,8 +472,8 @@ attempt the checkout for all registered files beneath it."
        (message "Checking out %s...done" file))))))
 
 (defun vc-rcs-rollback (files)
-  "Roll back, undoing the most recent checkins of FILES.  Directories are 
-expanded to all regidtered subfuiles in them."
+  "Roll back, undoing the most recent checkins of FILES.  Directories are
+expanded to all registered subfiles in them."
   (if (not files)
       (error "RCS backend doesn't support directory-level rollback."))
   (dolist (file (vc-expand-dirs files))
@@ -508,7 +509,7 @@ expanded to all regidtered subfuiles in them."
                         (signal (car err) (cdr err)))))))))
 
 (defun vc-rcs-revert (file &optional contents-done)
-  "Revert FILE to the version it was based on.  If FILE is a directory, 
+  "Revert FILE to the version it was based on.  If FILE is a directory,
 revert all registered files beneath it."
   (if (file-directory-p file)
       (mapc 'vc-rcs-revert (vc-expand-dirs (list file)))
@@ -526,7 +527,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
 
 (defun vc-rcs-steal-lock (file &optional rev)
   "Steal the lock on the current workfile for FILE and revision REV.
-If FUILEis a directory, steal the lock on all registered files beneath it.
+If FILE is a directory, steal the lock on all registered files beneath it.
 Needs RCS 5.6.2 or later for -M."
   (if (file-directory-p file)
       (mapc 'vc-rcs-steal-lock (vc-expand-dirs (list file)))
@@ -768,6 +769,8 @@ Optional arg REVISION is a revision to annotate from."
       (insert (gethash (get-text-property (point) :vc-rcs-r/d/a) ht))
       (forward-line 1))))
 
+(declare-function vc-annotate-convert-time "vc-annotate" (time))
+
 (defun vc-rcs-annotate-current-time ()
   "Return the current time, based at midnight of the current day, and
 encoded as fractional days."
@@ -787,12 +790,19 @@ systime, or nil if there is none.  Also, reposition point."
 
 \f
 ;;;
-;;; Snapshot system
+;;; Tag system
 ;;;
 
-(defun vc-rcs-assign-name (file name)
-  "Assign to FILE's latest version a given NAME."
-  (vc-do-command "*vc*" 0 "rcs" (vc-name file) (concat "-n" name ":")))
+(defun vc-rcs-create-tag (backend dir name branchp)
+  (when branchp
+    (error "RCS backend %s does not support module branches" backend))
+  (let ((result (vc-tag-precondition dir)))
+    (if (stringp result)
+       (error "File %s is not up-to-date" result)
+      (vc-file-tree-walk
+       dir
+       (lambda (f)
+        (vc-do-command "*vc*" 0 "rcs" (vc-name f) (concat "-n" name ":")))))))
 
 \f
 ;;;
@@ -825,9 +835,6 @@ systime, or nil if there is none.  Also, reposition point."
 ;;; Internal functions
 ;;;
 
-(defun vc-rcs-root (dir)
-  (vc-find-root dir "RCS" t))
-
 (defun vc-rcs-workfile-is-newer (file)
   "Return non-nil if FILE is newer than its RCS master.
 This likely means that FILE has been changed with respect
@@ -854,7 +861,7 @@ to its master version."
 
 (defun vc-rcs-fetch-master-state (file &optional working-revision)
   "Compute the master file's idea of the state of FILE.
-If a WORKFILE-VERSION is given, compute the state of that version,
+If a WORKING-REVISION is given, compute the state of that version,
 otherwise determine the workfile version based on the master file.
 This function sets the properties `vc-working-revision' and
 `vc-checkout-model' to their correct values, based on the master
@@ -1056,7 +1063,7 @@ CVS releases are handled reasonably, too \(1.3 < 1.4* < 1.5\)."
 
 (defun vc-rcs-system-release ()
   "Return the RCS release installed on this system, as a string.
-Return symbol UNKNOWN if the release cannot be deducted.  The user can
+Return symbol `unknown' if the release cannot be deducted.  The user can
 override this using variable `vc-rcs-release'.
 
 If the user has not set variable `vc-rcs-release' and it is nil,