   (easy-menu-add svn-log-view-mode-menu)
   (set (make-local-variable 'font-lock-defaults) '(svn-log-view-font-lock-keywords t)))
 
+(defun svn-log-view-next ()
+  (interactive)
+  (when (re-search-forward "^r[0-9]+" nil t)
+    (beginning-of-line 3)))
+
+(defun svn-log-view-prev ()
+  (interactive)
+  (when (re-search-backward "^r[0-9]+" nil t 2)
+    (beginning-of-line 3)))
+
+(defun svn-log-revision-at-point ()
+  (save-excursion
+    (re-search-backward "^r\\([0-9]+\\)")
+    (match-string-no-properties 1)))
+
 (defun svn-log-view-diff ()
   (interactive)
-  (message "Not yet implemented."))
+  (let ((upper-rev (svn-log-revision-at-point))
+        (lower-rev (save-excursion
+                     (svn-log-view-next)
+                     (svn-log-revision-at-point))))
+    (when (string= upper-rev lower-rev)
+      (setq lower-rev (number-to-string (- (string-to-number lower-rev) 1))))
+    (svn-run-svn nil t 'diff "diff" (concat "-r" lower-rev ":" upper-rev))
+    (svn-status-show-process-buffer-internal t)
+    (save-excursion
+      (set-buffer "*svn-process*")
+      (diff-mode)
+      (font-lock-fontify-buffer))))
 
 (provide 'psvn)
 

        (goto-char (point-min))
        (while (re-search-forward "\r$" (point-max) t)
          (replace-match "" nil nil))))))

(defun svn-status-file-name-sans-versions (name &optional keep-backup-version)
  "Strip the version info from a psvn revision file name."
  (string-match "\\(.+\\)\\.~.+~" name)
  (or (match-string-no-properties 1 name) name))

(condition-case nil
    ;;(easy-menu-add-item nil '("tools") ["SVN Status" svn-status t] "PCL-CVS")


(when (not svn-log-view-mode-map)
  (setq svn-log-view-mode-map (make-sparse-keymap))
  (define-key svn-log-view-mode-map (kbd "p") 'svn-log-view-prev)
  (define-key svn-log-view-mode-map (kbd "n") 'svn-log-view-next)
  (define-key svn-log-view-mode-map (kbd "=") 'svn-log-view-diff)
  (define-key svn-log-view-mode-map (kbd "q") 'bury-buffer))
(easy-menu-define svn-log-view-mode-menu svn-log-view-mode-map
