2008-05-09 Eric S. Raymond <esr@snark.thyrsus.com>
+ * vc-sccs.el, vc.svn.el, vc-git.el, vc-hg.el, vc-mtn.el: Remove
+ stub implementations of, and references to, wash-log.
+ * vc-rcs.el (vc-rcs-comment-history),
+ vc-cvs.el (vc-cvs-comment-history):
+ Inline the code that used to be wash-log.
+
* vc-scs.el (vc-sccs-checkin, vc-sccs-checkout, vc-sccs-rollback)
(vc-sccs-revert, vc-sccs-steal-lock, vc-sccs-modify-change-comment)
(vc-sccs-print-log, vc-sccs-diff): Grok directories.
(if (vc-stay-local-p files) 'async 0)
files "log"))
-(defun vc-cvs-wash-log ()
- "Remove all non-comment information from log output."
- (vc-call-backend 'RCS 'wash-log)
- nil)
+(defun vc-cvs-comment-history (file)
+ "Get comment history of a file."
+ (vc-call-backend 'RCS 'comment-history file))
(defun vc-cvs-diff (files &optional oldvers newvers buffer)
"Get a difference report using CVS between two revisions of FILE."
;; * print-log (files &optional buffer) OK
;; - log-view-mode () OK
;; - show-log-entry (revision) OK
-;; - wash-log (file) COULD BE SUPPORTED
;; - comment-history (file) ??
;; - update-changelog (files) COULD BE SUPPORTED
;; * diff (file &optional rev1 rev2 buffer) OK
;; * print-log (files &optional buffer) OK
;; - log-view-mode () OK
;; - show-log-entry (revision) NOT NEEDED, DEFAULT IS GOOD
-;; - wash-log (file) ??
;; - comment-history (file) NOT NEEDED
;; - update-changelog (files) NOT NEEDED
;; * diff (files &optional rev1 rev2 buffer) OK
;; (defun vc-mtn-show-log-entry (revision)
;; )
-(defun vc-mtn-wash-log (file))
-
(defun vc-mtn-diff (files &optional rev1 rev2 buffer)
(apply 'vc-mtn-command (or buffer "*vc-diff*") 1 files "diff"
(append (if rev1 (list "-r" rev1)) (if rev2 (list "-r" rev2)))))
(and newvers (concat "-r" newvers)))
(vc-switches 'RCS 'diff))))
-(defun vc-rcs-wash-log ()
- "Remove all non-comment information from log output."
- (let ((separator (concat "^-+\nrevision [0-9.]+\ndate: .*\n"
- "\\(branches: .*;\n\\)?"
- "\\(\\*\\*\\* empty log message \\*\\*\\*\n\\)?")))
- (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))
- (if (looking-at "[\b\t\n\v\f\r ]+")
- (delete-char (- (match-end 0) (match-beginning 0))))
- (goto-char (point-min))
- (re-search-forward separator nil t)
- (delete-region (point-min) (point))
- (while (re-search-forward separator nil t)
- (delete-region (match-beginning 0) (match-end 0)))))
+(defun vc-rcs-comment-history (file)
+ "Return a string with all log entries stored in BACKEND for FILE."
+ (with-current-buffer "*vc*"
+ ;; Has to be written this way, this function is used by the CVS backend too
+ (vc-call-backend (vc-backend file) 'print-log (list file))
+ ;; Remove cruft
+ (let ((separator (concat "^-+\nrevision [0-9.]+\ndate: .*\n"
+ "\\(branches: .*;\n\\)?"
+ "\\(\\*\\*\\* empty log message \\*\\*\\*\n\\)?")))
+ (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))
+ (if (looking-at "[\b\t\n\v\f\r ]+")
+ (delete-char (- (match-end 0) (match-beginning 0))))
+ (goto-char (point-min))
+ (re-search-forward separator nil t)
+ (delete-region (point-min) (point))
+ (while (re-search-forward separator nil t)
+ (delete-region (match-beginning 0) (match-end 0))))
+ ;; Return the de-crufted comment list
+ (buffer-string)))
(defun vc-rcs-annotate-command (file buffer &optional revision)
"Annotate FILE, inserting the results in BUFFER.
(setq files (vc-expand-dirs files))
(vc-sccs-do-command buffer 0 "prs" (mapcar 'vc-name files)))
-(defun vc-sccs-wash-log ()
- "Remove all non-comment information from log output."
- ;; FIXME: not implemented for SCCS
- nil)
-
(defun vc-sccs-diff (files &optional oldvers newvers buffer)
"Get a difference report using SCCS between two filesets."
(setq files (vc-expand-dirs files))
;; Dump log for the entire directory.
(vc-svn-command buffer 0 nil "log" "-rHEAD:0")))))
-(defun vc-svn-wash-log ()
- "Remove all non-comment information from log output."
- ;; FIXME: not implemented for SVN
- nil)
-
(defun vc-svn-diff (files &optional oldvers newvers buffer)
"Get a difference report using SVN between two revisions of fileset FILES."
(and oldvers
;; This mode is fully documented in the Emacs user's manual.
;;
;; Supported version-control systems presently include CVS, RCS, GNU
-;; Arch, Subversion, Bzr, Git, Mercurial, Meta-CVS, Monotone and SCCS
+;; Arch, Subversion, Bzr, Git, Mercurial, Monotone and SCCS
;; (or its free replacement, CSSC).
;;
;; Some features will not work with old RCS versions. Where
;; and make sure it is displayed in the buffer's window. The default
;; implementation of this function works for RCS-style logs.
;;
-;; - wash-log (file)
-;;
-;; Remove all non-comment information from the output of print-log.
-;;
;; - comment-history (file)
;;
;; Return a string containing all log entries that were made for FILE.
;; This is used for transferring a file from one backend to another,
-;; retaining comment information. The default implementation of this
-;; function does this by calling print-log and then wash-log, and
-;; returning the resulting buffer contents as a string.
+;; retaining comment information.
;;
;; - update-changelog (files)
;;
(when (vc-find-backend-function backend 'print-log)
(with-current-buffer "*vc*"
(vc-call-backend backend 'print-log (list file))
- (vc-call-backend backend 'wash-log)
(buffer-string))))
(defun vc-default-receive-file (backend file rev)