# HG changeset patch # User Dan Nicolaescu # Date 1251572172 0 # Node ID adeed914a5fba346a096cbfb4538ad4276f6d278 # Parent a211a43679df09f3c3bc1990c7580295a3a86fff * vc.el (vc-print-log-internal): Move RCS/CVS specific code ... * vc-rcs.el (vc-rcs-print-log-cleanup): ... here. New function. (vc-rcs-print-log): Use it. * vc-cvs.el (vc-cvs-print-log): Use vc-rcs-print-log-cleanup. diff -r a211a43679df -r adeed914a5fb lisp/ChangeLog --- a/lisp/ChangeLog Sat Aug 29 17:36:30 2009 +0000 +++ b/lisp/ChangeLog Sat Aug 29 18:56:12 2009 +0000 @@ -1,3 +1,12 @@ +2009-08-29 Dan Nicolaescu + + * vc.el (vc-print-log-internal): Move RCS/CVS specific code ... + + * vc-rcs.el (vc-rcs-print-log-cleanup): ... here. New function. + (vc-rcs-print-log): Use it. + + * vc-cvs.el (vc-cvs-print-log): Use vc-rcs-print-log-cleanup. + 2009-08-29 Stefan Monnier * files.el (get-free-disk-space): Use / for default-directory. diff -r a211a43679df -r adeed914a5fb lisp/vc-cvs.el --- a/lisp/vc-cvs.el Sat Aug 29 17:36:30 2009 +0000 +++ b/lisp/vc-cvs.el Sat Aug 29 18:56:12 2009 +0000 @@ -494,13 +494,18 @@ ;;; History functions ;;; +(declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) + (defun vc-cvs-print-log (files &optional buffer) "Get change logs associated with FILES." + (require 'vc-rcs) ;; It's just the catenation of the individual logs. (vc-cvs-command buffer (if (vc-stay-local-p files 'CVS) 'async 0) - files "log")) + files "log") + (with-current-buffer buffer + (vc-exec-after (vc-rcs-print-log-cleanup)))) (defun vc-cvs-comment-history (file) "Get comment history of a file." diff -r a211a43679df -r adeed914a5fb lisp/vc-rcs.el --- a/lisp/vc-rcs.el Sat Aug 29 17:36:30 2009 +0000 +++ b/lisp/vc-rcs.el Sat Aug 29 18:56:12 2009 +0000 @@ -538,10 +538,23 @@ ;;; History functions ;;; +(defun vc-rcs-print-log-cleanup () + (let ((inhibit-read-only t)) + (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)))))) + (defun vc-rcs-print-log (files &optional buffer) "Get change log associated with FILE. If FILE is a directory the operation is applied to all registered files beneath it." - (vc-do-command (or buffer "*vc*") 0 "rlog" (mapcar 'vc-name (vc-expand-dirs files)))) + (vc-do-command (or buffer "*vc*") 0 "rlog" (mapcar 'vc-name (vc-expand-dirs files))) + (with-current-buffer (or buffer "*vc*") + (vc-rcs-print-log-cleanup))) (defun vc-rcs-diff (files &optional oldvers newvers buffer) "Get a difference report using RCS between two sets of files." diff -r a211a43679df -r adeed914a5fb lisp/vc.el --- a/lisp/vc.el Sat Aug 29 17:36:30 2009 +0000 +++ b/lisp/vc.el Sat Aug 29 18:56:12 2009 +0000 @@ -1834,17 +1834,6 @@ (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)