[Top][All Lists]
[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: |
Thu, 08 May 2003 14:23:54 -0400 |
Index: emacs/lisp/vc-cvs.el
diff -c emacs/lisp/vc-cvs.el:1.56 emacs/lisp/vc-cvs.el:1.57
*** emacs/lisp/vc-cvs.el:1.56 Wed Apr 23 09:14:16 2003
--- emacs/lisp/vc-cvs.el Thu May 8 14:23:53 2003
***************
*** 5,11 ****
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <address@hidden>
! ;; $Id: vc-cvs.el,v 1.56 2003/04/23 13:14:16 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.57 2003/05/08 18:23:53 monnier Exp $
;; This file is part of GNU Emacs.
***************
*** 279,293 ****
(defun vc-cvs-dired-state-info (file)
"CVS-specific version of `vc-dired-state-info'."
! (let* ((cvs-state (vc-state file))
! (state (cond ((eq cvs-state 'edited) "modified")
! ((eq cvs-state 'needs-patch) "patch")
! ((eq cvs-state 'needs-merge) "merge")
! ;; FIXME: those two states cannot occur right now
! ((eq cvs-state 'unlocked-changes) "conflict")
! ((eq cvs-state 'locally-added) "added")
! )))
! (if state (concat "(" state ")"))))
;;;
--- 279,290 ----
(defun vc-cvs-dired-state-info (file)
"CVS-specific version of `vc-dired-state-info'."
! (let ((cvs-state (vc-state file)))
! (cond ((eq cvs-state 'edited)
! (if (equal (vc-workfile-version) "0")
! "(added)" "(modified)"))
! ((eq cvs-state 'needs-patch) "(patch)")
! ((eq cvs-state 'needs-merge) "(merge)"))))
;;;
***************
*** 448,454 ****
(if (and (file-exists-p file) (not rev))
;; If no revision was specified, just make the file writable
;; if necessary (using `cvs-edit' if requested).
! (and editable (not (eq (vc-cvs-checkout-model file)
'implicit))
(if vc-cvs-use-edit
(vc-cvs-command nil 0 file "edit")
(set-file-modes file (logior (file-modes file) 128))
--- 445,451 ----
(if (and (file-exists-p file) (not rev))
;; If no revision was specified, just make the file writable
;; if necessary (using `cvs-edit' if requested).
! (and editable (not (eq (vc-cvs-checkout-model file) 'implicit))
(if vc-cvs-use-edit
(vc-cvs-command nil 0 file "edit")
(set-file-modes file (logior (file-modes file) 128))
***************
*** 567,573 ****
;; Note: this is NOT a "cvs diff".
(apply 'vc-do-command "*vc-diff*"
1 "diff" file
! (append diff-switches-list '("/dev/null"))))
(setq status
(apply 'vc-cvs-command "*vc-diff*"
(if (and (vc-cvs-stay-local-p file)
--- 564,572 ----
;; Note: this is NOT a "cvs diff".
(apply 'vc-do-command "*vc-diff*"
1 "diff" file
! (append diff-switches-list '("/dev/null")))
! ;; Even if it's empty, it's locally modified.
! 1)
(setq status
(apply 'vc-cvs-command "*vc-diff*"
(if (and (vc-cvs-stay-local-p file)
***************
*** 725,776 ****
(defun vc-cvs-stay-local-p (file)
"Return non-nil if VC should stay local when handling FILE.
See `vc-cvs-stay-local'."
! (if vc-cvs-stay-local
! (let* ((dirname (if (file-directory-p file)
! (directory-file-name file)
! (file-name-directory file)))
! (prop
! (or (vc-file-getprop dirname 'vc-cvs-stay-local-p)
! (let ((rootname (expand-file-name "CVS/Root" dirname)))
! (vc-file-setprop
! dirname 'vc-cvs-stay-local-p
! (when (file-readable-p rootname)
! (with-temp-buffer
! (vc-insert-file rootname)
! (goto-char (point-min))
! (looking-at "\\([^\n]*\\)")
! (let* ((cvs-root-members
! (vc-cvs-parse-root (match-string 1)))
! (hostname (nth 2 cvs-root-members)))
! (if (not hostname)
! 'no
! (let ((stay-local t) rx)
! (cond
! ;; vc-cvs-stay-local: rx
! ((stringp vc-cvs-stay-local)
! (setq rx vc-cvs-stay-local))
! ;; vc-cvs-stay-local: '( [except] rx ... )
! ((consp vc-cvs-stay-local)
! (setq rx (mapconcat
! (function
! (lambda (elt)
! elt))
! (if (not (eq (car
vc-cvs-stay-local)
! 'except))
! vc-cvs-stay-local
! (setq stay-local nil)
! (cdr vc-cvs-stay-local))
! "\\|"))))
! (if (not rx)
! 'yes
! (if (not (string-match rx hostname))
! (setq stay-local (not stay-local)))
! (if stay-local
! 'yes
! 'no))))))))))))
! (if (eq prop 'yes) t nil))))
! (defun vc-cvs-parse-root ( root )
"Split CVS ROOT specification string into a list of fields.
A CVS root specification of the form
[:METHOD:address@hidden:]/path/to/repository
--- 724,778 ----
(defun vc-cvs-stay-local-p (file)
"Return non-nil if VC should stay local when handling FILE.
See `vc-cvs-stay-local'."
! (when vc-cvs-stay-local
! (let* ((dirname (if (file-directory-p file)
! (directory-file-name file)
! (file-name-directory file)))
! (prop
! (or (vc-file-getprop dirname 'vc-cvs-stay-local-p)
! (vc-file-setprop
! dirname 'vc-cvs-stay-local-p
! (let ((rootname (expand-file-name "CVS/Root" dirname)))
! (when (file-readable-p rootname)
! (with-temp-buffer
! (let ((coding-system-for-read
! (or file-name-coding-system
! default-file-name-coding-system)))
! (vc-insert-file rootname))
! (goto-char (point-min))
! (let* ((cvs-root-members
! (vc-cvs-parse-root
! (buffer-substring (point)
! (line-end-position))))
! (hostname (nth 2 cvs-root-members)))
! (if (not hostname)
! 'no
! (let* ((stay-local t)
! (rx
! (cond
! ;; vc-cvs-stay-local: rx
! ((stringp vc-cvs-stay-local)
! vc-cvs-stay-local)
! ;; vc-cvs-stay-local: '( [except] rx ... )
! ((consp vc-cvs-stay-local)
! (mapconcat
! 'identity
! (if (not (eq (car vc-cvs-stay-local)
! 'except))
! vc-cvs-stay-local
! (setq stay-local nil)
! (cdr vc-cvs-stay-local))
! "\\|")))))
! (if (not rx)
! 'yes
! (if (not (string-match rx hostname))
! (setq stay-local (not stay-local)))
! (if stay-local
! 'yes
! 'no))))))))))))
! (if (eq prop 'yes) t nil))))
! (defun vc-cvs-parse-root (root)
"Split CVS ROOT specification string into a list of fields.
A CVS root specification of the form
[:METHOD:address@hidden:]/path/to/repository
- [Emacs-diffs] Changes to emacs/lisp/vc-cvs.el,
Stefan Monnier <=