From: Dan Nicolaescu Date: Thu, 23 Jul 2009 05:21:34 +0000 (+0000) Subject: (vc-print-log-internal): New function, split out from ... X-Git-Tag: emacs-pretest-23.1.90~2049 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d6a62b0d7a23e494dc8adf06ca34d5b2cfe9c319;p=emacs.git (vc-print-log-internal): New function, split out from ... (vc-print-log): ... here. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0f249d105f..70b899c2f51 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-07-22 Dan Nicolaescu + * vc.el (vc-print-log-internal): New function, split out from ... + (vc-print-log): ... here. + * vc-git.el (vc-git-add-signoff): New variable. (vc-git-checkin): Use it. (vc-git-toggle-signoff): New function. diff --git a/lisp/vc.el b/lisp/vc.el index d063c2c8abc..590787e019c 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -1815,6 +1815,35 @@ allowed and simply skipped)." ;; Miscellaneous other entry points +(defun vc-print-log-internal (backend files working-revision) + ;; Don't switch to the output buffer before running the command, + ;; so that any buffer-local settings in the vc-controlled + ;; buffer can be accessed by the command. + (vc-call-backend backend 'print-log files "*vc-change-log*") + (pop-to-buffer "*vc-change-log*") + (vc-exec-after + `(let ((inhibit-read-only t)) + (vc-call-backend ',backend 'log-view-mode) + (set (make-local-variable 'log-view-vc-backend) ',backend) + (set (make-local-variable 'log-view-vc-fileset) ',files) + + ;; FIXME: this seems to apply only to RCS/CVS, it doesn't quite + ;; belong here in the generic code. + (goto-char (point-max)) + (forward-line -1) + (while (looking-at "=*\n") + (delete-char (- (match-end 0) (match-beginning 0))) + (forward-line -1)) + (goto-char (point-min)) + (when (looking-at "[\b\t\n\v\f\r ]+") + (delete-char (- (match-end 0) (match-beginning 0)))) + + (shrink-window-if-larger-than-buffer) + ;; move point to the log entry for the working revision + (vc-call-backend ',backend 'show-log-entry ',working-revision) + (setq vc-sentinel-movepoint (point)) + (set-buffer-modified-p nil)))) + ;;;###autoload (defun vc-print-log (&optional working-revision) "List the change log of the current fileset in a window. @@ -1824,28 +1853,7 @@ If WORKING-REVISION is non-nil, leave the point at that revision." (backend (car vc-fileset)) (files (cadr vc-fileset)) (working-revision (or working-revision (vc-working-revision (car files))))) - ;; Don't switch to the output buffer before running the command, - ;; so that any buffer-local settings in the vc-controlled - ;; buffer can be accessed by the command. - (vc-call-backend backend 'print-log files "*vc-change-log*") - (pop-to-buffer "*vc-change-log*") - (vc-exec-after - `(let ((inhibit-read-only t)) - (vc-call-backend ',backend 'log-view-mode) - (set (make-local-variable 'log-view-vc-backend) ',backend) - (set (make-local-variable 'log-view-vc-fileset) ',files) - (goto-char (point-max)) (forward-line -1) - (while (looking-at "=*\n") - (delete-char (- (match-end 0) (match-beginning 0))) - (forward-line -1)) - (goto-char (point-min)) - (when (looking-at "[\b\t\n\v\f\r ]+") - (delete-char (- (match-end 0) (match-beginning 0)))) - (shrink-window-if-larger-than-buffer) - ;; move point to the log entry for the working revision - (vc-call-backend ',backend 'show-log-entry ',working-revision) - (setq vc-sentinel-movepoint (point)) - (set-buffer-modified-p nil))))) + (vc-print-log-internal backend files working-revision))) ;;;###autoload (defun vc-revert ()