• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching defs:vc

0 ;;; vc-cvs.el --- non-resident support for CVS version-control
6 ;; Author: FSF (see vc.el for full credits)
33 (require 'vc))
39 (defcustom vc-cvs-global-switches nil
47 :group 'vc)
49 (defcustom vc-cvs-register-switches nil
52 \\[vc-register]."
59 :group 'vc)
61 (defcustom vc-cvs-diff-switches nil
69 :group 'vc)
71 (defcustom vc-cvs-header (or (cdr (assoc 'CVS vc-header-alist)) '("\$Id\$"))
72 "*Header keywords to be inserted by `vc-insert-headers'."
75 :group 'vc)
77 (defcustom vc-cvs-use-edit t
83 :group 'vc)
85 (defcustom vc-cvs-stay-local t
103 :group 'vc)
105 (defcustom vc-cvs-sticky-date-format-string "%c"
108 `vc-cvs-sticky-tag-display' is t."
111 :group 'vc)
113 (defcustom vc-cvs-sticky-tag-display t
127 vc-cvs-sticky-date-format-string tag))
147 See also variable `vc-cvs-sticky-date-format-string'."
150 :group 'vc)
161 ;;;###autoload (defun vc-cvs-registered (f)
164 ;;;###autoload (load "vc-cvs")
165 ;;;###autoload (vc-cvs-registered f)))
167 (defun vc-cvs-registered (file)
175 (vc-cvs-get-entries dirname)
182 (vc-cvs-parse-entry file)
187 (defun vc-cvs-state (file)
188 "CVS-specific version of `vc-state'."
189 (if (vc-stay-local-p file)
190 (let ((state (vc-file-getprop file 'vc-state)))
194 (vc-cvs-state-heuristic file)
198 (vc-cvs-command t 0 file "status")
199 (vc-cvs-parse-status t))))
201 (defun vc-cvs-state-heuristic (file)
205 (let ((checkout-time (vc-file-getprop file 'vc-checkout-time))
211 (defun vc-cvs-dir-state (dir)
215 (if (vc-stay-local-p dir)
216 (vc-cvs-dir-state-heuristic dir)
221 (vc-cvs-command t 0 nil "status" "-l")
225 (vc-cvs-parse-status)
229 (defun vc-cvs-workfile-version (file)
230 "CVS-specific version of `vc-workfile-version'."
234 (vc-cvs-registered file)
235 (vc-file-getprop file 'vc-workfile-version))
237 (defun vc-cvs-checkout-model (file)
238 "CVS-specific version of `vc-checkout-model'."
246 ;; (If vc-mistrust-permissions was t, we actually shouldn't
253 (defun vc-cvs-mode-line-string (file)
258 (let ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag))
259 (string (if (string= (vc-workfile-version file) "0")
262 (vc-default-mode-line-string 'CVS file))))
267 (defun vc-cvs-dired-state-info (file)
268 "CVS-specific version of `vc-dired-state-info'."
269 (let ((cvs-state (vc-state file)))
271 (if (equal (vc-workfile-version file) "0")
281 (defun vc-cvs-register (file &optional rev comment)
285 `vc-register-switches' and `vc-cvs-register-switches' are passed to
287 (when (and (not (vc-cvs-responsible-p file))
288 (vc-cvs-could-register file))
290 (vc-cvs-register (directory-file-name (file-name-directory file))))
291 (apply 'vc-cvs-command nil 0 file
295 (vc-switches 'CVS 'register)))
297 (defun vc-cvs-responsible-p (file)
304 (defun vc-cvs-could-register (file)
317 (defun vc-cvs-checkin (file rev comment)
318 "CVS-specific version of `vc-backend-checkin'."
319 (unless (or (not rev) (vc-cvs-valid-version-number-p rev))
320 (if (not (vc-cvs-valid-symbolic-tag-name-p rev))
324 (apply 'vc-cvs-command nil 0 file "tag" "-b" (list rev))
325 (apply 'vc-cvs-command nil 0 file "update" "-r" (list rev))
326 (vc-file-setprop file 'vc-cvs-sticky-tag rev)))
327 (let ((status (apply 'vc-cvs-command nil 1 file
330 (vc-switches 'CVS 'checkin))))
331 (set-buffer "*vc*")
337 (vc-file-setprop file 'vc-state 'needs-merge)
340 "type \\[vc-next-action] to merge in changes"))))
347 (vc-file-setprop
348 file 'vc-workfile-version
349 (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2))
353 ;; vc-cvs-checkout-model).
354 (vc-file-setprop file 'vc-checkout-model nil)
358 (if (and rev (not (vc-cvs-valid-symbolic-tag-name-p rev)))
359 (vc-cvs-command nil 0 file "update" "-A"))))
361 (defun vc-cvs-find-version (file rev buffer)
362 (apply 'vc-cvs-command
369 (vc-switches 'CVS 'checkout)))
371 (defun vc-cvs-checkout (file &optional editable rev workfile)
380 ;; Change buffers to get local value of vc-checkout-switches.
382 (setq switches (vc-switches 'CVS 'checkout))
406 (apply 'vc-cvs-command
423 (not vc-make-backup-files)
428 (and editable (not (eq (vc-cvs-checkout-model file) 'implicit))
429 (if vc-cvs-use-edit
430 (vc-cvs-command nil 0 file "edit")
434 (vc-file-setprop file 'vc-workfile-version nil)
435 (apply 'vc-cvs-command nil 0 file
438 (not (eq (vc-cvs-checkout-model file)
451 (vc-mode-line file)
454 (defun vc-cvs-delete-file (file)
455 (vc-cvs-command nil 0 file "remove" "-f")
456 (vc-cvs-command nil 0 file "commit" "-mRemoved."))
458 (defun vc-cvs-revert (file &optional contents-done)
463 (vc-cvs-checkout file nil (vc-workfile-version file) file))
464 (unless (eq (vc-checkout-model file) 'implicit)
465 (if vc-cvs-use-edit
466 (vc-cvs-command nil 0 file "unedit")
470 (defun vc-cvs-merge (file first-version &optional second-version)
473 (vc-cvs-command nil 0 file
477 (vc-file-setprop file 'vc-state 'edited)
478 (with-current-buffer (get-buffer "*vc*")
484 (defun vc-cvs-merge-news (file)
487 ;; (vc-file-setprop file 'vc-workfile-version nil)
488 (vc-file-setprop file 'vc-checkout-time 0)
489 (vc-cvs-command nil 0 file "update")
492 (with-current-buffer (get-buffer "*vc*")
497 (vc-file-setprop file 'vc-workfile-version (match-string 1))
498 (vc-file-setprop file 'vc-workfile-version nil))
513 (vc-file-setprop file 'vc-state 'up-to-date)
514 (vc-file-setprop file 'vc-checkout-time
519 (vc-file-setprop file 'vc-state 'edited)
523 (vc-file-setprop file 'vc-state 'edited)
526 (pop-to-buffer "*vc*")
535 (defun vc-cvs-print-log (file &optional buffer)
537 (vc-cvs-command
539 (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
542 (defun vc-cvs-diff (file &optional oldvers newvers buffer)
544 (if (string= (vc-workfile-version file) "0")
551 (apply 'vc-do-command (or buffer "*vc-diff*")
553 (append (vc-switches nil 'diff) '("/dev/null")))
556 (let* ((async (and (not vc-disable-async-diff)
557 (vc-stay-local-p file)
559 (status (apply 'vc-cvs-command (or buffer "*vc-diff*")
564 (vc-switches 'CVS 'diff))))
567 (defun vc-cvs-diff-tree (dir &optional rev1 rev2)
569 (with-current-buffer "*vc-diff*"
571 (if (vc-stay-local-p dir)
573 (vc-file-tree-walk
576 (vc-exec-after
577 `(let ((coding-system-for-read (vc-coding-system-for-diff ',f)))
579 ;; in the tree via vc-cvs-dir-state-heuristic
580 (unless (vc-up-to-date-p ',f)
582 (vc-diff-internal ',f ',rev1 ',rev2))))))
586 (apply 'vc-cvs-command "*vc-diff*" 1 nil "diff"
589 (vc-switches 'CVS 'diff))))))
591 (defun vc-cvs-annotate-command (file buffer &optional version)
594 (vc-cvs-command buffer 0 file "annotate" (if version (concat "-r" version)))
600 (defun vc-cvs-annotate-current-time ()
603 (vc-annotate-convert-time
606 (defun vc-cvs-annotate-time ()
610 (cache (get-text-property bol 'vc-cvs-annotate-time))
630 bol (1+ bol) 'vc-cvs-annotate-time
634 (vc-annotate-convert-time
640 (defun vc-cvs-annotate-extract-revision-at-line ()
652 (defun vc-cvs-create-snapshot (dir name branchp)
656 (vc-cvs-command nil 0 dir "tag" "-c" (if branchp "-b") name)
657 (when branchp (vc-cvs-command nil 0 dir "update" "-r" name)))
659 (defun vc-cvs-retrieve-snapshot (dir name update)
663 (with-current-buffer (get-buffer-create "*vc*")
668 (vc-cvs-command t 0 nil "update")
669 (vc-cvs-command t 0 nil "update" "-r" name)
682 (vc-file-setprop file 'vc-state 'up-to-date)
683 (vc-file-setprop file 'vc-workfile-version nil)
684 (vc-file-setprop file 'vc-checkout-time
688 (vc-file-setprop file 'vc-state 'edited)
689 (vc-file-setprop file 'vc-workfile-version nil)
690 (vc-file-setprop file 'vc-checkout-time 0)))
691 (vc-file-setprop file 'vc-cvs-sticky-tag sticky-tag)
692 (vc-resynch-buffer file t t))))
700 (defalias 'vc-cvs-make-version-backups-p 'vc-stay-local-p
703 (defun vc-cvs-check-headers ()
715 (defun vc-cvs-command (buffer okstatus file &rest flags)
716 "A wrapper around `vc-do-command' for use in vc-cvs.el.
717 The difference to vc-do-command is that this function always invokes `cvs',
718 and that it passes `vc-cvs-global-switches' to it before FLAGS."
719 (apply 'vc-do-command buffer okstatus "cvs" file
720 (if (stringp vc-cvs-global-switches)
721 (cons vc-cvs-global-switches flags)
722 (append vc-cvs-global-switches
725 (defalias 'vc-cvs-stay-local-p 'vc-stay-local-p) ;Back-compatibility.
727 (defun vc-cvs-repository-hostname (dirname)
735 (vc-insert-file rootname))
737 (nth 2 (vc-cvs-parse-root
741 (defun vc-cvs-parse-root (root)
800 (defun vc-cvs-parse-status (&optional full)
811 (vc-file-setprop file 'vc-backend 'CVS)
820 (vc-file-setprop file 'vc-latest-version (match-string 2)))
821 (vc-file-setprop
822 file 'vc-state
825 (vc-file-setprop file 'vc-checkout-time
833 (defun vc-cvs-dir-state-heuristic (dir)
836 (vc-cvs-get-entries dir)
842 (unless (vc-file-getprop file 'vc-state)
843 (vc-cvs-parse-entry file t))))
846 (defun vc-cvs-get-entries (dir)
853 (vc-insert-file (expand-file-name "CVS/Entries" dir))))
855 (defun vc-cvs-valid-symbolic-tag-name-p (tag)
863 (defun vc-cvs-valid-version-number-p (tag)
868 (defun vc-cvs-parse-sticky-tag (match-type match-tag)
875 (if (vc-cvs-valid-symbolic-tag-name-p match-tag)
905 (cond ((eq vc-cvs-sticky-tag-display nil) nil)
906 ((eq vc-cvs-sticky-tag-display t)
908 vc-cvs-sticky-date-format-string
913 ((functionp vc-cvs-sticky-tag-display)
914 (funcall vc-cvs-sticky-tag-display tag type))
919 (defun vc-cvs-parse-entry (file &optional set-state)
922 accordingly. However, `vc-state' is set only if optional arg SET-STATE
927 (vc-file-setprop file 'vc-checkout-time 0)
928 (vc-file-setprop file 'vc-workfile-version "0")
929 (if set-state (vc-file-setprop file 'vc-state 'edited)))
942 (vc-file-setprop file 'vc-workfile-version (match-string 1))
943 (vc-file-setprop file 'vc-cvs-sticky-tag
944 (vc-cvs-parse-sticky-tag (match-string 4)
957 (vc-file-setprop file 'vc-checkout-time mtime)
958 (if set-state (vc-file-setprop file 'vc-state 'up-to-date)))
960 (vc-file-setprop file 'vc-checkout-time 0)
961 (if set-state (vc-file-setprop file 'vc-state 'edited)))))))))
963 (provide 'vc-cvs)
966 ;;; vc-cvs.el ends here