From f6a884097ce09911f9f111c3c6248859699f89cd Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 19 Oct 2024 02:25:52 +0100 Subject: [PATCH] Fix the regression in dired-backup-diff's diff-goto-source behavior * 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 71754aa1ca9..6695ae54dbd 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -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")) -- 2.39.2