Don't call turn_on_atimers around `connect' (Bug#5723).
[bpt/emacs.git] / lisp / vc-cvs.el
index 6ef8db5..8f9d077 100644 (file)
@@ -1,7 +1,7 @@
 ;;; vc-cvs.el --- non-resident support for CVS version-control
 
 ;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;   2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Andre Spiegel <spiegel@gnu.org>
@@ -225,7 +225,8 @@ See also variable `vc-cvs-sticky-date-format-string'."
          state))
     (with-temp-buffer
       (cd (file-name-directory file))
-      (vc-cvs-command t 0 file "status")
+      (let (process-file-side-effects)
+       (vc-cvs-command t 0 file "status"))
       (vc-cvs-parse-status t))))
 
 (defun vc-cvs-state-heuristic (file)
@@ -312,7 +313,7 @@ its parents."
                   (directory-file-name dir))))
     (eq dir t)))
 
-(defun vc-cvs-checkin (files rev comment)
+(defun vc-cvs-checkin (files rev comment  &optional extra-args-ignored)
   "CVS-specific version of `vc-backend-checkin'."
   (unless (or (not rev) (vc-cvs-valid-revision-number-p rev))
     (if (not (vc-cvs-valid-symbolic-tag-name-p rev))
@@ -458,7 +459,8 @@ The changes are between FIRST-REVISION and SECOND-REVISION."
           (if (re-search-forward
                (concat "^\\([CMUP] \\)?"
                        (regexp-quote
-                        (substring file (length default-directory)))
+                        (substring file (1+ (length (expand-file-name
+                                                     "." default-directory)))))
                        "\\( already contains the differences between \\)?")
                nil t)
               (cond
@@ -492,13 +494,19 @@ Will fail unless you have administrative privileges on the repo."
 ;;; History functions
 ;;;
 
-(defun vc-cvs-print-log (files &optional buffer)
+(declare-function vc-rcs-print-log-cleanup "vc-rcs" ())
+
+(defun vc-cvs-print-log (files buffer &optional shortlog start-revision-ignored limit)
   "Get change logs associated with FILES."
+  (require 'vc-rcs)
   ;; It's just the catenation of the individual logs.
   (vc-cvs-command
    buffer
    (if (vc-stay-local-p files 'CVS) 'async 0)
-   files "log"))
+   files "log")
+  (with-current-buffer buffer
+    (vc-exec-after (vc-rcs-print-log-cleanup)))
+  (when limit 'limit-unsupported))
 
 (defun vc-cvs-comment-history (file)
   "Get comment history of a file."
@@ -506,7 +514,8 @@ Will fail unless you have administrative privileges on the repo."
 
 (defun vc-cvs-diff (files &optional oldvers newvers buffer)
   "Get a difference report using CVS between two revisions of FILE."
-  (let* ((async (and (not vc-disable-async-diff)
+  (let* (process-file-side-effects
+        (async (and (not vc-disable-async-diff)
                     (vc-stay-local-p files 'CVS)))
         (invoke-cvs-diff-list nil)
         status)
@@ -630,6 +639,16 @@ systime, or nil if there is none."
        (match-string-no-properties 1)
       nil)))
 
+(defun vc-cvs-previous-revision (file rev)
+  (vc-call-backend 'RCS 'previous-revision file rev))
+
+(defun vc-cvs-next-revision (file rev)
+  (vc-call-backend 'RCS 'next-revision file rev))
+
+;; FIXME: This should probably be replaced by code using cvs2cl.
+(defun vc-cvs-update-changelog (files)
+  (vc-call-backend 'RCS 'update-changelog files))
+
 ;;;
 ;;; Tag system
 ;;;
@@ -937,6 +956,7 @@ state."
   )
 
 ;; Based on vc-cvs-dir-state-heuristic from Emacs 22.
+;; FIXME does not mention unregistered files.
 (defun vc-cvs-dir-status-heuristic (dir update-function &optional basedir)
   "Find the CVS state of all files in DIR, using only local information."
   (let (file basename status result dirlist)
@@ -1146,18 +1166,18 @@ is non-nil."
     ;; This is intentionally different from the algorithm that CVS uses
     ;; (which is based on textual comparison), because there can be problems
     ;; generating a time string that looks exactly like the one from CVS.
-    (let ((mtime (nth 5 (file-attributes file))))
-      (require 'parse-time)
-      (let ((parsed-time
-            (parse-time-string (concat (match-string 2) " +0000"))))
-       (cond ((and (not (string-match "\\+" (match-string 2)))
-                   (car parsed-time)
-                   (equal mtime (apply 'encode-time parsed-time)))
-              (vc-file-setprop file 'vc-checkout-time mtime)
-              (if set-state (vc-file-setprop file 'vc-state 'up-to-date)))
-             (t
-              (vc-file-setprop file 'vc-checkout-time 0)
-              (if set-state (vc-file-setprop file 'vc-state 'edited)))))))))
+    (let* ((time (match-string 2))
+           (mtime (nth 5 (file-attributes file)))
+           (parsed-time (progn (require 'parse-time)
+                               (parse-time-string (concat time " +0000")))))
+      (cond ((and (not (string-match "\\+" time))
+                  (car parsed-time)
+                  (equal mtime (apply 'encode-time parsed-time)))
+             (vc-file-setprop file 'vc-checkout-time mtime)
+             (if set-state (vc-file-setprop file 'vc-state 'up-to-date)))
+            (t
+             (vc-file-setprop file 'vc-checkout-time 0)
+             (if set-state (vc-file-setprop file 'vc-state 'edited))))))))
 
 ;; Completion of revision names.
 ;; Just so I don't feel like I'm duplicating code from pcl-cvs, I'll use
@@ -1165,7 +1185,8 @@ is non-nil."
 ;; tag names.
 
 (defun vc-cvs-revision-table (file)
-  (let ((default-directory (file-name-directory file))
+  (let (process-file-side-effects
+       (default-directory (file-name-directory file))
         (res nil))
     (with-temp-buffer
       (vc-cvs-command t nil file "log")