Mercurial > emacs
comparison lisp/vc-dispatcher.el @ 94572:3bdffe280ad3
Remove logentry primitive from backend API.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Sat, 03 May 2008 07:39:17 +0000 |
parents | 61cca370b8f5 |
children | ce09c5078ae7 |
comparison
equal
deleted
inserted
replaced
94571:61cca370b8f5 | 94572:3bdffe280ad3 |
---|---|
136 (inhibit-read-only t)) | 136 (inhibit-read-only t)) |
137 (goto-char (process-mark p)) | 137 (goto-char (process-mark p)) |
138 (insert s) | 138 (insert s) |
139 (set-marker (process-mark p) (point)))))))) | 139 (set-marker (process-mark p) (point)))))))) |
140 | 140 |
141 (defun vc-setup-buffer (&optional buf) | 141 (defun vc-setup-buffer (buf) |
142 "Prepare BUF for executing a VC command and make it current. | 142 "Prepare BUF for executing a slave command and make it current." |
143 BUF defaults to \"*vc*\", can be a string and will be created if necessary." | |
144 (unless buf (setq buf "*vc*")) | |
145 (let ((camefrom (current-buffer)) | 143 (let ((camefrom (current-buffer)) |
146 (olddir default-directory)) | 144 (olddir default-directory)) |
147 (set-buffer (get-buffer-create buf)) | 145 (set-buffer (get-buffer-create buf)) |
148 (kill-all-local-variables) | 146 (kill-all-local-variables) |
149 (set (make-local-variable 'vc-parent-buffer) camefrom) | 147 (set (make-local-variable 'vc-parent-buffer) camefrom) |
499 (when (stringp comment) (insert comment))) | 497 (when (stringp comment) (insert comment))) |
500 (if (or (not comment) initial-contents) | 498 (if (or (not comment) initial-contents) |
501 (message "%s Type C-c C-c when done" msg) | 499 (message "%s Type C-c C-c when done" msg) |
502 (vc-finish-logentry (eq comment t))))) | 500 (vc-finish-logentry (eq comment t))))) |
503 | 501 |
504 ;; FIXME: Reference to vc-call-backend should go. | |
505 (defun vc-finish-logentry (&optional nocomment) | 502 (defun vc-finish-logentry (&optional nocomment) |
506 "Complete the operation implied by the current log entry. | 503 "Complete the operation implied by the current log entry. |
507 Use the contents of the current buffer as a check-in or registration | 504 Use the contents of the current buffer as a check-in or registration |
508 comment. If the optional arg NOCOMMENT is non-nil, then don't check | 505 comment. If the optional arg NOCOMMENT is non-nil, then don't check |
509 the buffer contents as a comment." | 506 the buffer contents as a comment." |
510 (interactive) | 507 (interactive) |
511 ;; Check and record the comment, if any. | 508 ;; Check and record the comment, if any. |
512 (unless nocomment | 509 (unless nocomment |
513 ;; Comment too long? | |
514 (vc-call-backend (or (when vc-log-fileset (vc-backend vc-log-fileset)) | |
515 (vc-responsible-backend default-directory)) | |
516 'logentry-check) | |
517 (run-hooks 'vc-logentry-check-hook)) | 510 (run-hooks 'vc-logentry-check-hook)) |
518 ;; Sync parent buffer in case the user modified it while editing the comment. | 511 ;; Sync parent buffer in case the user modified it while editing the comment. |
519 ;; But not if it is a vc-dired buffer. | 512 ;; But not if it is a vc-dired buffer. |
520 (with-current-buffer vc-parent-buffer | 513 (with-current-buffer vc-parent-buffer |
521 (or vc-dired-mode (eq major-mode 'vc-dir-mode) (vc-buffer-sync))) | 514 (or vc-dired-mode (eq major-mode 'vc-dir-mode) (vc-buffer-sync))) |
554 (when vc-dired-mode | 547 (when vc-dired-mode |
555 (dired-move-to-filename)) | 548 (dired-move-to-filename)) |
556 (when (eq major-mode 'vc-dir-mode) | 549 (when (eq major-mode 'vc-dir-mode) |
557 (vc-dir-move-to-goal-column)) | 550 (vc-dir-move-to-goal-column)) |
558 (run-hooks after-hook 'vc-finish-logentry-hook))) | 551 (run-hooks after-hook 'vc-finish-logentry-hook))) |
559 | |
560 | 552 |
561 ;; The VC directory major mode. Coopt Dired for this. | 553 ;; The VC directory major mode. Coopt Dired for this. |
562 ;; All VC commands get mapped into logical equivalents. | 554 ;; All VC commands get mapped into logical equivalents. |
563 | 555 |
564 (defvar vc-dired-switches) | 556 (defvar vc-dired-switches) |