]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the regression in dired-backup-diff's diff-goto-source behavior
authorDmitry Gutov <dmitry@gutov.dev>
Sat, 19 Oct 2024 01:25:52 +0000 (02:25 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 22 Oct 2024 18:54:45 +0000 (20:54 +0200)
* lisp/vc/diff-mode.el (diff-find-source-location): Undo part of
the previous change, so that 'reverse' does not affect whether the
"other file" is used (bug#62731).
(diff-apply-hunk): Make that choice here.

(cherry picked from commit 1374f20491bbf0c37760cdb84f6020f80fe4eadd)

lisp/vc/diff-mode.el

index 71754aa1ca9cfb74d36a4f4cf92cb27d2ab811f4..6695ae54dbd5f344c6e5b868296bb120b6385bb2 100644 (file)
@@ -1969,7 +1969,7 @@ SWITCHED is non-nil if the patch is already applied."
                                 diff-context-mid-hunk-header-re nil t)
                         (error "Can't find the hunk separator"))
                       (match-string 1)))))
-          (file (or (diff-find-file-name (xor other reverse) noprompt)
+          (file (or (diff-find-file-name other noprompt)
                      (error "Can't find the file")))
           (revision (and other diff-vc-backend
                           (if reverse (nth 1 diff-vc-revisions)
@@ -2053,7 +2053,7 @@ With a prefix argument, REVERSE the hunk."
                ;; TODO: make it possible to ask explicitly for this behavior.
                ;;
                ;; This is duplicated in diff-test-hunk.
-               (diff-find-source-location deletion reverse)))
+               (diff-find-source-location (xor deletion reverse) reverse)))
     (cond
      ((null line-offset)
       (user-error "Can't find the text to patch"))