aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorTino Calancha2017-03-21 17:25:55 +0900
committerTino Calancha2017-03-21 17:25:55 +0900
commitabe731eef0fcbc59ef4836e06f6099ea17042b90 (patch)
tree6611bae15f92a0451acf7ce02128cab09d6dfb95 /lisp
parent205223f4725864e1fb53df5cd12694d0bc89f7d0 (diff)
downloademacs-abe731eef0fcbc59ef4836e06f6099ea17042b90.tar.gz
emacs-abe731eef0fcbc59ef4836e06f6099ea17042b90.zip
epatch: Save right backups in Git multipatches
Multipatches on N Git files save wrong backups for N-1 files; only the last one has a correct backup (Bug#26084). * lisp/vc/diff-mode.el (diff-file-junk-re): Add 'Prereq: ' * lisp/vc/ediff-ptch.el (ediff-map-patch-buffer): Use 'diff-file-junk-re'. * test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug25010): Rename from ibuffer-test-bug25010. (ediff-ptch-test-bug26084): New test.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/vc/diff-mode.el2
-rw-r--r--lisp/vc/ediff-ptch.el13
2 files changed, 7 insertions, 8 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 31c33e6a720..aa8d77882ec 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -504,7 +504,7 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html")
504;; "index ", "old mode", "new mode", "new file mode" and 504;; "index ", "old mode", "new mode", "new file mode" and
505;; "deleted file mode" are output by git-diff. 505;; "deleted file mode" are output by git-diff.
506(defconst diff-file-junk-re 506(defconst diff-file-junk-re
507 (concat "Index: \\|=\\{20,\\}\\|" ; SVN 507 (concat "Index: \\|Prereq: \\|=\\{20,\\}\\|" ; SVN
508 "diff \\|index \\|\\(?:deleted file\\|new\\(?: file\\)?\\|old\\) mode\\|=== modified file")) 508 "diff \\|index \\|\\(?:deleted file\\|new\\(?: file\\)?\\|old\\) mode\\|=== modified file"))
509 509
510;; If point is in a diff header, then return beginning 510;; If point is in a diff header, then return beginning
diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el
index 9d2ec51b596..36aebf4aed1 100644
--- a/lisp/vc/ediff-ptch.el
+++ b/lisp/vc/ediff-ptch.el
@@ -25,6 +25,8 @@
25;;; Code: 25;;; Code:
26 26
27 27
28(require 'diff-mode) ; For `diff-file-junk-re'.
29
28(provide 'ediff-ptch) 30(provide 'ediff-ptch)
29 31
30(defgroup ediff-ptch nil 32(defgroup ediff-ptch nil
@@ -225,14 +227,11 @@ program."
225 (if (and beg2 end2) 227 (if (and beg2 end2)
226 (buffer-substring beg2 end2) 228 (buffer-substring beg2 end2)
227 "/dev/null"))) 229 "/dev/null")))
228 ;; check for any `Index:' or `Prereq:' lines, but don't use them 230 ;; Remove file junk (Bug#26084).
229 (if (re-search-backward "^Index:" mark1-end 'noerror) 231 (while (re-search-backward
230 (move-marker mark2 (match-beginning 0))) 232 (concat "^" diff-file-junk-re) mark1-end t)
231 (if (re-search-backward "^Prereq:" mark1-end 'noerror) 233 (move-marker mark2 (match-beginning 0)))
232 (move-marker mark2 (match-beginning 0)))
233
234 (goto-char mark2-end) 234 (goto-char mark2-end)
235
236 (if filenames 235 (if filenames
237 (setq patch-map 236 (setq patch-map
238 (cons (ediff-make-new-meta-list-element 237 (cons (ediff-make-new-meta-list-element