comparison lisp/vc-mcvs.el @ 89909:68c22ea6027c

Sync to HEAD
author Kenichi Handa <handa@m17n.org>
date Fri, 16 Apr 2004 12:51:06 +0000
parents 375f2633d815
children 4c90ffeb71c5
comparison
equal deleted inserted replaced
89908:ee1402f7b568 89909:68c22ea6027c
1 ;;; vc-mcvs.el --- VC backend for the Meta-CVS version-control system 1 ;;; vc-mcvs.el --- VC backend for the Meta-CVS version-control system
2 2
3 ;; Copyright (C) 1995,98,99,2000,01,02,2003 Free Software Foundation, Inc. 3 ;; Copyright (C) 1995,98,99,2000,01,02,03,2004 Free Software Foundation, Inc.
4 4
5 ;; Author: FSF (see vc.el for full credits) 5 ;; Author: FSF (see vc.el for full credits)
6 ;; Maintainer: Stefan Monnier <monnier@gnu.org> 6 ;; Maintainer: Stefan Monnier <monnier@gnu.org>
7 7
8 ;; This file is part of GNU Emacs. 8 ;; This file is part of GNU Emacs.
168 ;; The file might not be registered yet because 168 ;; The file might not be registered yet because
169 ;; of lazy-adding. 169 ;; of lazy-adding.
170 0)) 170 0))
171 t))) 171 t)))
172 172
173 (defmacro vc-mcvs-cvs (op file &rest args)
174 (declare (debug t))
175 `(,(intern (concat "vc-cvs-" (symbol-name op)))
176 (expand-file-name (vc-file-getprop ,file 'mcvs-inode)
177 (vc-file-getprop ,file 'mcvs-root))
178 ,@args))
179
180 (defun vc-mcvs-state (file) 173 (defun vc-mcvs-state (file)
181 ;; This would assume the Meta-CVS sandbox is synchronized. 174 ;; This would assume the Meta-CVS sandbox is synchronized.
182 ;; (vc-mcvs-cvs state file)) 175 ;; (vc-mcvs-cvs state file))
183 "Meta-CVS-specific version of `vc-state'." 176 "Meta-CVS-specific version of `vc-state'."
184 (if (vc-stay-local-p file) 177 (if (vc-stay-local-p file)
213 (narrow-to-region (match-beginning 0) (match-end 0)) 206 (narrow-to-region (match-beginning 0) (match-end 0))
214 (vc-cvs-parse-status) 207 (vc-cvs-parse-status)
215 (goto-char (point-max)) 208 (goto-char (point-max))
216 (widen))))))) 209 (widen)))))))
217 210
218 (defun vc-mcvs-workfile-version (file) (vc-mcvs-cvs workfile-version file)) 211 (defun vc-mcvs-workfile-version (file)
212 (vc-cvs-workfile-version
213 (expand-file-name (vc-file-getprop file 'mcvs-inode)
214 (vc-file-getprop file 'mcvs-root))))
219 215
220 (defalias 'vc-mcvs-checkout-model 'vc-cvs-checkout-model) 216 (defalias 'vc-mcvs-checkout-model 'vc-cvs-checkout-model)
221
222 (defun vc-mcvs-mode-line-string (file)
223 (let ((s (vc-mcvs-cvs mode-line-string file)))
224 (when s
225 (if (and (not (memq (vc-state file) '(up-to-date needs-patch)))
226 (string-match "\\`CVS-" s))
227 ;; The CVS file is not in sync, so we need to adjust the state.
228 (concat "MCVS:" (substring s 4))
229 (concat "M" s)))))
230 217
231 ;;; 218 ;;;
232 ;;; State-changing functions 219 ;;; State-changing functions
233 ;;; 220 ;;;
234 221
587 ;; No need to filter: do it the easy way. 574 ;; No need to filter: do it the easy way.
588 (apply 'vc-do-command buffer okstatus "mcvs" file args) 575 (apply 'vc-do-command buffer okstatus "mcvs" file args)
589 ;; We need to filter the output. 576 ;; We need to filter the output.
590 ;; The output of the filter uses filenames relative to the root, 577 ;; The output of the filter uses filenames relative to the root,
591 ;; so we need to change the default-directory. 578 ;; so we need to change the default-directory.
592 (assert (equal default-directory (vc-mcvs-root file))) 579 ;; (assert (equal default-directory (vc-mcvs-root file)))
593 (vc-do-command 580 (vc-do-command
594 buffer okstatus "sh" nil "-c" 581 buffer okstatus "sh" nil "-c"
595 (concat "mcvs " 582 (concat "mcvs "
596 (mapconcat 583 (mapconcat
597 'shell-quote-argument 584 'shell-quote-argument
618 605
619 (defalias 'vc-mcvs-valid-symbolic-tag-name-p 'vc-cvs-valid-symbolic-tag-name-p) 606 (defalias 'vc-mcvs-valid-symbolic-tag-name-p 'vc-cvs-valid-symbolic-tag-name-p)
620 (defalias 'vc-mcvs-valid-version-number-p 'vc-cvs-valid-version-number-p) 607 (defalias 'vc-mcvs-valid-version-number-p 'vc-cvs-valid-version-number-p)
621 608
622 (provide 'vc-mcvs) 609 (provide 'vc-mcvs)
610
611 ;;; arch-tag: a39c7c1c-5247-429d-88df-dd7187d2e704
623 ;;; vc-mcvs.el ends here 612 ;;; vc-mcvs.el ends here