     (beginning-of-line 2)
     (unless (looking-at "Changed paths:")
       (beginning-of-line 1))))
+
+(defun svn-log-mark-partner-revision ()
+  "Mark the revision at point to be used as diff against revision."
+  (interactive)
+  (let ((start-pos)
+        (point-at-partner-rev))
+    (dolist (ov (overlays-in (point-min) (point-max)))
+      (when (overlay-get ov 'svn-log-partner-revision)
+        (setq point-at-partner-rev (and (>= (point) (overlay-start ov))
+                                        (<= (point) (overlay-end ov))))
+        (delete-overlay ov)))
+    (unless point-at-partner-rev
+      (save-excursion
+        (when (re-search-backward "^r[0-9]+" nil t 1)
+          (setq start-pos (point))
+          (re-search-forward "^---------------")
+          (setq overlay (make-overlay start-pos (line-beginning-position 0)))
+          (overlay-put overlay 'face 'svn-log-partner-highlight-face)
+          (overlay-put overlay 'svn-log-partner-revision t))))))
+
+(defun svn-log-exchange-partner-mark-with-point ()
+  (interactive)
+  (let ((cur-pos (point))
+        (dest-pos))
+    (dolist (ov (overlays-in (point-min) (point-max)))
+      (when (overlay-get ov 'svn-log-partner-revision)
+        (setq dest-pos (overlay-start ov))))
+    (when dest-pos
+      (svn-log-mark-partner-revision)
+      (goto-char dest-pos)
+      (forward-line 3)
+      (svn-log-view-prev)
+      (svn-log-view-next))))
+
+(defun svn-log-revision-for-diff ()
+  (let ((rev))
+    (dolist (ov (overlays-in (point-min) (point-max)))
+      (when (overlay-get ov 'svn-log-partner-revision)
+        (save-excursion
+          (unless (and (>= (point) (overlay-start ov))
+                       (<= (point) (overlay-end ov)))
+            (goto-char (overlay-start ov))
+            (setq rev (svn-log-revision-at-point))))))
+    rev))
 
 (defun svn-log-revision-at-point ()
   (save-excursion

                                     (not (svn-status-some-files-marked-p))
                                     (if arg :ask "BASE")))

(defun svn-status-diff-show-changeset (rev &optional user-confirmation)
  "Show the changeset for a given log entry.
When called with a prefix argument, ask the user for the revision."
  (let* ((upper-rev rev)
         (lower-rev (number-to-string (- (string-to-number upper-rev) 1)))
         (rev-arg (concat lower-rev ":" upper-rev)))
    (when user-confirmation
      (setq rev-arg (read-string "Revision for changeset: " rev-arg)))

  (defface svn-status-blame-highlight-face
    '((t :inherit highlight))
    "Default face for highlighting a line in svn status blame mode."
    :group 'psvn-faces))

(if svn-xemacsp
    (defface svn-log-partner-highlight-face
      '((((type tty) (class color)) (:foreground "yellow" :weight light))
        (((class color) (background light)) (:foreground "gold"))
        (((class color) (background dark)) (:foreground "gold"))
        (t (:weight bold)))
      "Default face for highlighting the partner in svn log mode."
      :group 'psvn-faces)
  (defface svn-log-partner-highlight-face
  '((((class color) (background light))
     (:background "light goldenrod" :weight bold))
    (t (:weight bold)))
    "Default face for highlighting the partner in svn log mode."
    :group 'psvn-faces))

(defface svn-status-blame-rev-number-face
