* vc-p4.el (vc-p4-diff): Fix Perforce file headers.

[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7485]
This commit is contained in:
Magnus Henoch 2009-11-16 14:10:55 -08:00
parent 4667f79c0a
commit 2e8b1f0015

View file

@ -553,7 +553,17 @@ files under the default directory otherwise."
((and rev1 (not rev2)) ((and rev1 (not rev2))
(p4-lowlevel-diff file rev1)))) (p4-lowlevel-diff file rev1))))
(insert-buffer-substring temp-buffer) (insert-buffer-substring temp-buffer)
(kill-buffer temp-buffer)))))))) (kill-buffer temp-buffer))))))
;; Emacs doesn't understand Perforce's file headers, so we add
;; them ourselves.
(with-current-buffer buffer
(goto-char (point-min))
(while (re-search-forward "^==== \\(.+#[0-9]+\\) - \\(.+\\) ====$" nil t)
(let ((depot-name (match-string 1))
(filename (match-string 2)))
(insert "\n--- " depot-name
"\n+++ " filename))))))
(defun vc-p4-annotate-command (file buffer &optional version) (defun vc-p4-annotate-command (file buffer &optional version)
"Annotate FILE into BUFFER file using `vc-p4-annotate-command'. "Annotate FILE into BUFFER file using `vc-p4-annotate-command'.