changeset 50928:dc235df7e226

(vc-mcvs-stay-local): Remove unused var. (vc-mcvs-state, vc-mcvs-dir-state, vc-mcvs-print-log, vc-mcvs-diff) (vc-mcvs-diff-tree, vc-mcvs-annotate-command) (vc-mcvs-make-version-backups-p): Use vc-stay-local-p. (vc-mcvs-checkin): Disallow commits to a numbered rev. (vc-mcvs-repository-hostname): New function. (vc-mcvs-stay-local-p): Remove.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 09 May 2003 17:05:40 +0000
parents 6f478e2878c7
children 068965f379b3
files lisp/vc-mcvs.el
diffstat 1 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc-mcvs.el	Fri May 09 16:41:19 2003 +0000
+++ b/lisp/vc-mcvs.el	Fri May 09 17:05:40 2003 +0000
@@ -177,7 +177,7 @@
   ;; This would assume the Meta-CVS sandbox is synchronized.
   ;; (vc-mcvs-cvs state file))
   "Meta-CVS-specific version of `vc-state'."
-  (if (vc-mcvs-stay-local-p file)
+  (if (vc-stay-local-p file)
       (let ((state (vc-file-getprop file 'vc-state)))
         ;; If we should stay local, use the heuristic but only if
         ;; we don't have a more precise state already available.
@@ -196,7 +196,7 @@
   "Find the Meta-CVS state of all files in DIR."
   ;; if DIR is not under Meta-CVS control, don't do anything.
   (when (file-readable-p (expand-file-name "MCVS/CVS/Entries" dir))
-    (if (vc-mcvs-stay-local-p dir)
+    (if (vc-stay-local-p dir)
 	(vc-mcvs-dir-state-heuristic dir)
       (let ((default-directory dir))
 	;; Don't specify DIR in this command, the default-directory is
@@ -282,15 +282,17 @@
   (unless (or (not rev) (vc-mcvs-valid-version-number-p rev))
     (if (not (vc-mcvs-valid-symbolic-tag-name-p rev))
 	(error "%s is not a valid symbolic tag name" rev)
-      ;; If the input revison is a valid symbolic tag name, we create it
+      ;; If the input revision is a valid symbolic tag name, we create it
       ;; as a branch, commit and switch to it.
       (apply 'vc-mcvs-command nil 0 file "tag" "-b" (list rev))
       (apply 'vc-mcvs-command nil 0 file "update" "-r" (list rev))
       (vc-file-setprop file 'vc-mcvs-sticky-tag rev)
       (setq rev nil)))
+  ;; This commit might cvs-commit several files (e.g. MAP and TYPES)
+  ;; so using numbered revs here is dangerous and somewhat meaningless.
+  (when rev (error "Cannot commit to a specific revision number"))
   (let ((status (apply 'vc-mcvs-command nil 1 file
-		       "ci" (if rev (concat "-r" rev))
-		       "-m" comment
+		       "ci" "-m" comment
 		       (vc-switches 'MCVS 'checkin))))
     (set-buffer "*vc*")
     (goto-char (point-min))
@@ -440,7 +442,7 @@
   "Get change log associated with FILE."
   (vc-mcvs-command
    nil
-   (if (and (vc-mcvs-stay-local-p file) (fboundp 'start-process)) 'async 0)
+   (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
    file "log"))
 
 (defun vc-mcvs-diff (file &optional oldvers newvers)
@@ -457,7 +459,7 @@
 	       (append (vc-switches nil 'diff) '("/dev/null")))
 	;; Even if it's empty, it's locally modified.
 	1)
-    (let* ((async (and (vc-mcvs-stay-local-p file) (fboundp 'start-process)))
+    (let* ((async (and (vc-stay-local-p file) (fboundp 'start-process)))
 	   (status
 	    (apply 'vc-mcvs-command "*vc-diff*"
 		   (if async 'async 1)
@@ -471,7 +473,7 @@
   "Diff all files at and below DIR."
   (with-current-buffer "*vc-diff*"
     (setq default-directory dir)
-    (if (vc-mcvs-stay-local-p dir)
+    (if (vc-stay-local-p dir)
         ;; local diff: do it filewise, and only for files that are modified
         (vc-file-tree-walk
          dir
@@ -496,7 +498,7 @@
 Optional arg VERSION is a version to annotate from."
   (vc-mcvs-command
    buffer
-   (if (and (vc-mcvs-stay-local-p file) (fboundp 'start-process)) 'async 0)
+   (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
    file "annotate" (if version (concat "-r" version))))
 
 (defalias 'vc-mcvs-annotate-current-time 'vc-cvs-annotate-current-time)
@@ -554,7 +556,7 @@
 ;;; Miscellaneous
 ;;;
 
-(defalias 'vc-mcvs-make-version-backups-p 'vc-mcvs-stay-local-p
+(defalias 'vc-mcvs-make-version-backups-p 'vc-stay-local-p
   "Return non-nil if version backups should be made for FILE.")
 (defalias 'vc-mcvs-check-headers 'vc-cvs-check-headers)
 
@@ -584,7 +586,8 @@
 			       " | mcvs filt"))
       (apply 'vc-do-command buffer okstatus "mcvs" file args))))
 
-(defun vc-mcvs-stay-local-p (file) (vc-mcvs-cvs stay-local-p file))
+(defun vc-mcvs-repository-hostname (dirname)
+  (vc-cvs-repository-hostname (vc-mcvs-root dirname)))
 
 (defun vc-mcvs-dir-state-heuristic (dir)
   "Find the Meta-CVS state of all files in DIR, using only local information."