emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/vc-cvs.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/vc-cvs.el
Date: Sat, 19 Apr 2003 18:40:19 -0400

Index: emacs/lisp/vc-cvs.el
diff -c emacs/lisp/vc-cvs.el:1.53 emacs/lisp/vc-cvs.el:1.54
*** emacs/lisp/vc-cvs.el:1.53   Sat Apr  5 10:51:14 2003
--- emacs/lisp/vc-cvs.el        Sat Apr 19 18:40:18 2003
***************
*** 5,11 ****
  ;; Author:      FSF (see vc.el for full credits)
  ;; Maintainer:  Andre Spiegel <address@hidden>
  
! ;; $Id: vc-cvs.el,v 1.53 2003/04/05 15:51:14 spiegel Exp $
  
  ;; This file is part of GNU Emacs.
  
--- 5,11 ----
  ;; Author:      FSF (see vc.el for full credits)
  ;; Maintainer:  Andre Spiegel <address@hidden>
  
! ;; $Id: vc-cvs.el,v 1.54 2003/04/19 22:40:18 monnier Exp $
  
  ;; This file is part of GNU Emacs.
  
***************
*** 207,227 ****
  
  (defun vc-cvs-dir-state (dir)
    "Find the CVS state of all files in DIR."
!   ;; if DIR is not under CVS control, don't do anything
!   (if (file-readable-p (expand-file-name "CVS/Entries" dir))
!       (if (vc-cvs-stay-local-p dir)
!           (vc-cvs-dir-state-heuristic dir)
!         (let ((default-directory dir))
!           ;; Don't specify DIR in this command, the default-directory is
!           ;; enough.  Otherwise it might fail with remote repositories.
!           (with-temp-buffer
!             (vc-do-command t 0 "cvs" nil "status" "-l")
!             (goto-char (point-min))
!             (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t)
!               (narrow-to-region (match-beginning 0) (match-end 0))
!               (vc-cvs-parse-status)
!               (goto-char (point-max))
!               (widen)))))))
  
  (defun vc-cvs-workfile-version (file)
    "CVS-specific version of `vc-workfile-version'."
--- 207,227 ----
  
  (defun vc-cvs-dir-state (dir)
    "Find the CVS state of all files in DIR."
!   ;; if DIR is not under CVS control, don't do anything.
!   (when (file-readable-p (expand-file-name "CVS/Entries" dir))
!     (if (vc-cvs-stay-local-p dir)
!       (vc-cvs-dir-state-heuristic dir)
!       (let ((default-directory dir))
!       ;; Don't specify DIR in this command, the default-directory is
!       ;; enough.  Otherwise it might fail with remote repositories.
!       (with-temp-buffer
!         (vc-cvs-command t 0 nil "status" "-l")
!         (goto-char (point-min))
!         (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t)
!           (narrow-to-region (match-beginning 0) (match-end 0))
!           (vc-cvs-parse-status)
!           (goto-char (point-max))
!           (widen)))))))
  
  (defun vc-cvs-workfile-version (file)
    "CVS-specific version of `vc-workfile-version'."
***************
*** 292,310 ****
  
  `vc-register-switches' and `vc-cvs-register-switches' are passed to
  the CVS command (in that order)."
!     (let ((switches (append
!                    (if (stringp vc-register-switches)
!                        (list vc-register-switches)
!                      vc-register-switches)
!                    (if (stringp vc-cvs-register-switches)
!                        (list vc-cvs-register-switches)
!                      vc-cvs-register-switches))))
! 
!       (apply 'vc-cvs-command nil 0 file
!            "add"
!            (and comment (string-match "[^\t\n ]" comment)
!                 (concat "-m" comment))
!            switches)))
  
  (defun vc-cvs-responsible-p (file)
    "Return non-nil if CVS thinks it is responsible for FILE."
--- 292,310 ----
  
  `vc-register-switches' and `vc-cvs-register-switches' are passed to
  the CVS command (in that order)."
!   (let ((switches (append
!                  (if (stringp vc-register-switches)
!                      (list vc-register-switches)
!                    vc-register-switches)
!                  (if (stringp vc-cvs-register-switches)
!                      (list vc-cvs-register-switches)
!                    vc-cvs-register-switches))))
! 
!     (apply 'vc-cvs-command nil 0 file
!          "add"
!          (and comment (string-match "[^\t\n ]" comment)
!               (concat "-m" comment))
!          switches)))
  
  (defun vc-cvs-responsible-p (file)
    "Return non-nil if CVS thinks it is responsible for FILE."
***************
*** 313,322 ****
                                          file
                                        (file-name-directory file)))))
  
! (defun vc-cvs-could-register (file)
    "Return non-nil if FILE could be registered in CVS.
! This is only possible if CVS is responsible for FILE's directory."
!   (vc-cvs-responsible-p file))
  
  (defun vc-cvs-checkin (file rev comment)
    "CVS-specific version of `vc-backend-checkin'."
--- 313,321 ----
                                          file
                                        (file-name-directory file)))))
  
! (defalias 'vc-cvs-could-register 'vc-cvs-responsible-p
    "Return non-nil if FILE could be registered in CVS.
! This is only possible if CVS is responsible for FILE's directory.")
  
  (defun vc-cvs-checkin (file rev comment)
    "CVS-specific version of `vc-backend-checkin'."
***************
*** 484,491 ****
                   (concat "-j" first-version)
                   (concat "-j" second-version))
    (vc-file-setprop file 'vc-state 'edited)
!   (save-excursion
!     (set-buffer (get-buffer "*vc*"))
      (goto-char (point-min))
      (if (re-search-forward "conflicts during merge" nil t)
          1                             ; signal error
--- 483,489 ----
                   (concat "-j" first-version)
                   (concat "-j" second-version))
    (vc-file-setprop file 'vc-state 'edited)
!   (with-current-buffer (get-buffer "*vc*")
      (goto-char (point-min))
      (if (re-search-forward "conflicts during merge" nil t)
          1                             ; signal error
***************
*** 494,512 ****
  (defun vc-cvs-merge-news (file)
    "Merge in any new changes made to FILE."
    (message "Merging changes into %s..." file)
!   (save-excursion
!     ;; (vc-file-setprop file 'vc-workfile-version nil)
!     (vc-file-setprop file 'vc-checkout-time 0)
!     (vc-cvs-command nil 0 file "update")
!     ;; Analyze the merge result reported by CVS, and set
!     ;; file properties accordingly.
!     (set-buffer (get-buffer "*vc*"))
      (goto-char (point-min))
      ;; get new workfile version
!     (if (re-search-forward (concat "^Merging differences between "
!                                  "[01234567890.]* and "
!                                  "\\([01234567890.]*\\) into")
!                          nil t)
        (vc-file-setprop file 'vc-workfile-version (match-string 1))
        (vc-file-setprop file 'vc-workfile-version nil))
      ;; get file status
--- 492,507 ----
  (defun vc-cvs-merge-news (file)
    "Merge in any new changes made to FILE."
    (message "Merging changes into %s..." file)
!   ;; (vc-file-setprop file 'vc-workfile-version nil)
!   (vc-file-setprop file 'vc-checkout-time 0)
!   (vc-cvs-command nil 0 file "update")
!   ;; Analyze the merge result reported by CVS, and set
!   ;; file properties accordingly.
!   (with-current-buffer (get-buffer "*vc*")
      (goto-char (point-min))
      ;; get new workfile version
!     (if (re-search-forward
!        "^Merging differences between [0-9.]* and \\([0-9.]*\\) into" nil t)
        (vc-file-setprop file 'vc-workfile-version (match-string 1))
        (vc-file-setprop file 'vc-workfile-version nil))
      ;; get file status
***************
*** 554,560 ****
  
  (defun vc-cvs-diff (file &optional oldvers newvers)
    "Get a difference report using CVS between two versions of FILE."
!   (let (options status (diff-switches-list (vc-diff-switches-list 'CVS)))
      (if (string= (vc-workfile-version file) "0")
        ;; This file is added but not yet committed; there is no master file.
        (if (or oldvers newvers)
--- 549,555 ----
  
  (defun vc-cvs-diff (file &optional oldvers newvers)
    "Get a difference report using CVS between two versions of FILE."
!   (let (status (diff-switches-list (vc-diff-switches-list 'CVS)))
      (if (string= (vc-workfile-version file) "0")
        ;; This file is added but not yet committed; there is no master file.
        (if (or oldvers newvers)
***************
*** 694,702 ****
  ;;; Miscellaneous
  ;;;
  
! (defun vc-cvs-make-version-backups-p (file)
!   "Return non-nil if version backups should be made for FILE."
!   (vc-cvs-stay-local-p file))
  
  (defun vc-cvs-check-headers ()
    "Check if the current file has any headers in it."
--- 689,696 ----
  ;;; Miscellaneous
  ;;;
  
! (defalias 'vc-cvs-make-version-backups-p 'vc-cvs-stay-local-p
!   "Return non-nil if version backups should be made for FILE.")
  
  (defun vc-cvs-check-headers ()
    "Check if the current file has any headers in it."
***************
*** 891,908 ****
      (vc-file-setprop file 'vc-cvs-sticky-tag
                     (vc-cvs-parse-sticky-tag (match-string 4) (match-string 
5)))
      ;; compare checkout time and modification time
!     (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)))))))))
  
  (provide 'vc-cvs)
  
--- 885,903 ----
      (vc-file-setprop file 'vc-cvs-sticky-tag
                     (vc-cvs-parse-sticky-tag (match-string 4) (match-string 
5)))
      ;; compare checkout time and modification time
!     (let* ((mtime (nth 5 (file-attributes file)))
!          (system-time-locale "C")
!          (mtstr (format-time-string "%c" mtime 'utc)))
!       ;; Solaris sometimes uses "Wed Sep 05" instead of  "Wed Sep  5".
!       ;; See "grep '[^a-z_]ctime' cvs/src/*.c" for reference.
!       (if (= (aref mtstr 8) ?0)
!         (setq mtstr (concat (substring mtstr 0 8) " " (substring mtstr 9))))
!       (cond ((equal mtstr (match-string 2))
!            (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))))))))
  
  (provide 'vc-cvs)
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]