changeset 94806:eedf64b515f0

Remove wash-log from the VC backend API.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Fri, 09 May 2008 17:30:49 +0000
parents 89d37b54b964
children d58ec1c0d828
files lisp/ChangeLog lisp/vc-cvs.el lisp/vc-git.el lisp/vc-hg.el lisp/vc-mtn.el lisp/vc-rcs.el lisp/vc-sccs.el lisp/vc-svn.el lisp/vc.el
diffstat 9 files changed, 34 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri May 09 16:41:26 2008 +0000
+++ b/lisp/ChangeLog	Fri May 09 17:30:49 2008 +0000
@@ -1,5 +1,11 @@
 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.
--- a/lisp/vc-cvs.el	Fri May 09 16:41:26 2008 +0000
+++ b/lisp/vc-cvs.el	Fri May 09 17:30:49 2008 +0000
@@ -492,10 +492,9 @@
    (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."
--- a/lisp/vc-git.el	Fri May 09 16:41:26 2008 +0000
+++ b/lisp/vc-git.el	Fri May 09 17:30:49 2008 +0000
@@ -79,7 +79,6 @@
 ;; * 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
--- a/lisp/vc-hg.el	Fri May 09 16:41:26 2008 +0000
+++ b/lisp/vc-hg.el	Fri May 09 17:30:49 2008 +0000
@@ -68,7 +68,6 @@
 ;; * 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
--- a/lisp/vc-mtn.el	Fri May 09 16:41:26 2008 +0000
+++ b/lisp/vc-mtn.el	Fri May 09 17:30:49 2008 +0000
@@ -175,8 +175,6 @@
 ;; (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)))))
--- a/lisp/vc-rcs.el	Fri May 09 16:41:26 2008 +0000
+++ b/lisp/vc-rcs.el	Fri May 09 17:30:49 2008 +0000
@@ -547,23 +547,29 @@
                        (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.
--- a/lisp/vc-sccs.el	Fri May 09 16:41:26 2008 +0000
+++ b/lisp/vc-sccs.el	Fri May 09 17:30:49 2008 +0000
@@ -332,11 +332,6 @@
   (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))
--- a/lisp/vc-svn.el	Fri May 09 16:41:26 2008 +0000
+++ b/lisp/vc-svn.el	Fri May 09 17:30:49 2008 +0000
@@ -431,11 +431,6 @@
 	;; 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
--- a/lisp/vc.el	Fri May 09 16:41:26 2008 +0000
+++ b/lisp/vc.el	Fri May 09 17:30:49 2008 +0000
@@ -55,7 +55,7 @@
 ;; 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
@@ -371,17 +371,11 @@
 ;;   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)
 ;;
@@ -2709,7 +2703,6 @@
   (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)