]> code.delx.au - gnu-emacs/blobdiff - lisp/vc-mcvs.el
(calendar-dst-check-each-year-flag): Avoid
[gnu-emacs] / lisp / vc-mcvs.el
index 5c0bac48b3aaf8b4a5f5c491fb9a321d2e909470..4075ffc3649cfe25b2d8fcc7109916cb7072be16 100644 (file)
@@ -1,6 +1,6 @@
 ;;; vc-mcvs.el --- VC backend for the Meta-CVS version-control system
 
-;; Copyright (C) 1995,98,99,2000,01,02,03,2004  Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Stefan Monnier <monnier@gnu.org>
 
 ;; 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:
 
 ;; The home page of the Meta-CVS version control system is at
-;; 
+;;
 ;;      http://users.footprints.net/~kaz/mcvs.html
-;; 
+;;
 ;; This is derived from vc-cvs.el as follows:
 ;; - cp vc-cvs.el vc-mcvs.el
 ;; - Replace CVS/ with MCVS/CVS/
@@ -69,7 +69,7 @@
                 (repeat :tag "Argument List"
                         :value ("")
                         string))
-  :version "21.4"
+  :version "22.1"
   :group 'vc)
 
 (defcustom vc-mcvs-register-switches nil
@@ -81,7 +81,7 @@ A string or list of strings passed to the checkin program by
                 (repeat :tag "Argument List"
                         :value ("")
                         string))
-  :version "21.4"
+  :version "22.1"
   :group 'vc)
 
 (defcustom vc-mcvs-diff-switches nil
@@ -91,13 +91,13 @@ A string or list of strings passed to the checkin program by
                 (repeat :tag "Argument List"
                         :value ("")
                         string))
-  :version "21.4"
+  :version "22.1"
   :group 'vc)
 
 (defcustom vc-mcvs-header (or (cdr (assoc 'MCVS vc-header-alist))
                              vc-cvs-header)
   "*Header keywords to be inserted by `vc-insert-headers'."
-  :version "21.4"
+  :version "22.1"
   :type '(repeat string)
   :group 'vc)
 
@@ -106,7 +106,7 @@ A string or list of strings passed to the checkin program by
 This is only meaningful if you don't use the implicit checkout model
 \(i.e. if you have $CVSREAD set)."
   :type 'boolean
-  :version "21.4"
+  :version "22.1"
   :group 'vc)
 
 ;;;
@@ -114,32 +114,15 @@ This is only meaningful if you don't use the implicit checkout model
 ;;;
 
 ;;;###autoload (defun vc-mcvs-registered (file)
-;;;###autoload   (let ((dir file))
-;;;###autoload     (while (and (stringp dir)
-;;;###autoload                 (not (equal
-;;;###autoload                       dir (setq dir (file-name-directory dir))))
-;;;###autoload                 dir)
-;;;###autoload       (setq dir (if (file-directory-p
-;;;###autoload                      (expand-file-name "MCVS/CVS" dir))
-;;;###autoload                     t (directory-file-name dir))))
-;;;###autoload     (if (eq dir t)
-;;;###autoload          (progn
-;;;###autoload           (load "vc-mcvs")
-;;;###autoload           (vc-mcvs-registered file)))))
+;;;###autoload   (if (vc-find-root file "MCVS/CVS")
+;;;###autoload       (progn
+;;;###autoload         (load "vc-mcvs")
+;;;###autoload         (vc-mcvs-registered file))))
 
 (defun vc-mcvs-root (file)
   "Return the root directory of a Meta-CVS project, if any."
   (or (vc-file-getprop file 'mcvs-root)
-      (vc-file-setprop
-       file 'mcvs-root
-       (let ((root nil))
-        (while (not (or root
-                        (equal file (setq file (file-name-directory file)))
-                        (null file)))
-          (if (file-directory-p (expand-file-name "MCVS/CVS" file))
-              (setq root file)
-            (setq file (directory-file-name file))))
-        root))))
+      (vc-file-setprop file 'mcvs-root (vc-find-root file "MCVS/CVS"))))
 
 (defun vc-mcvs-read (file)
   (if (file-readable-p file)
@@ -242,7 +225,7 @@ the Meta-CVS command (in that order)."
     ;; Make sure the `mcvs add' will not fire up the CVSEDITOR
     ;; to add a rule for the given file's extension.
     (when (and ext (not (assoc ext types)))
-      (let ((type (completing-read "Type to use [default]: "
+      (let ((type (completing-read "Type to use (default): "
                                   '("default" "name-only" "keep-old"
                                     "binary" "value-only")
                                   nil t nil nil "default")))
@@ -367,7 +350,7 @@ This is only possible if Meta-CVS is responsible for FILE's directory.")
 
 (defun vc-mcvs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
-  (vc-default-revert file contents-done)
+  (vc-default-revert 'MCVS file contents-done)
   (unless (eq (vc-checkout-model file) 'implicit)
     (if vc-mcvs-use-edit
         (vc-mcvs-command nil 0 file "unedit")
@@ -462,7 +445,9 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
               (append (vc-switches nil 'diff) '("/dev/null")))
        ;; Even if it's empty, it's locally modified.
        1)
-    (let* ((async (and (vc-stay-local-p file) (fboundp 'start-process)))
+    (let* ((async (and (not vc-disable-async-diff)
+                       (vc-stay-local-p file)
+                       (fboundp 'start-process)))
           ;; Run the command from the root dir so that `mcvs filt' returns
           ;; valid relative names.
           (default-directory (vc-mcvs-root file))
@@ -494,7 +479,11 @@ Optional arg VERSION is a version to annotate from."
   (vc-mcvs-command
    buffer
    (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
-   file "annotate" (if version (concat "-r" version))))
+   file "annotate" (if version (concat "-r" version)))
+  (with-current-buffer buffer
+    (goto-char (point-min))
+    (re-search-forward "^[0-9]")
+    (delete-region (point-min) (1- (point)))))
 
 (defalias 'vc-mcvs-annotate-current-time 'vc-cvs-annotate-current-time)
 (defalias 'vc-mcvs-annotate-time 'vc-cvs-annotate-time)
@@ -608,5 +597,5 @@ and that it passes `vc-mcvs-global-switches' to it before FLAGS."
 
 (provide 'vc-mcvs)
 
-;;; arch-tag: a39c7c1c-5247-429d-88df-dd7187d2e704
+;; arch-tag: a39c7c1c-5247-429d-88df-dd7187d2e704
 ;;; vc-mcvs.el ends here