+2012-07-16 Michael Albinus <michael.albinus@gmx.de>
+
+ * vc/ediff.el (ediff-directories): Add trailing space to prompts.
+
+ * vc/ediff-diff.el (ediff-same-file-contents): Handle the case,
+ when F1 and F2 are located on different hosts.
+
2012-07-14 Chong Yidong <cyd@gnu.org>
* xt-mouse.el: Implement extended mouse coordinates (Bug#10642).
"Return t if files F1 and F2 have identical contents."
(if (and (not (file-directory-p f1))
(not (file-directory-p f2)))
- (let ((res
- ;; In the remote case, this works only if F1 and F2 are
- ;; located on the same remote host.
- (apply 'process-file ediff-cmp-program nil nil nil
- (append ediff-cmp-options
- (list (or (file-remote-p f1 'localname)
- (expand-file-name f1))
- (or (file-remote-p f2 'localname)
- (expand-file-name f2)))))
- ))
- (and (numberp res) (eq res 0)))
- ))
+ (if (equal (file-remote-p f1) (file-remote-p f2))
+ (let ((res
+ ;; In the remote case, this works only if F1 and F2 are
+ ;; located on the same remote host.
+ (apply 'process-file ediff-cmp-program nil nil nil
+ (append ediff-cmp-options
+ (list (or (file-remote-p f1 'localname)
+ (expand-file-name f1))
+ (or (file-remote-p f2 'localname)
+ (expand-file-name f2)))))
+ ))
+ (and (numberp res) (eq res 0)))
+
+ ;; F1 and F2 are not located on the same host.
+ (let ((t1 (file-local-copy f1))
+ (t2 (file-local-copy f2)))
+ (unwind-protect
+ (ediff-same-file-contents (or t1 f1) (or t2 f2))
+ (and t1 (delete-file t1))
+ (and t2 (delete-file t2))))
+ )))
(defun ediff-same-contents (d1 d2 &optional filter-re)
(setq buf-B-file-name (file-name-nondirectory buf-B-file-name)))
(if (stringp buf-C-file-name)
(setq buf-C-file-name (file-name-nondirectory buf-C-file-name)))
-
+
(setq file-A (ediff-make-temp-file buf-A buf-A-file-name)
file-B (ediff-make-temp-file buf-B buf-B-file-name))
(if buf-C-is-alive
(setq file-C (ediff-make-temp-file buf-C buf-C-file-name)))
-
+
(ediff-setup (get-buffer buf-A) file-A
(get-buffer buf-B) file-B
(if buf-C-is-alive (get-buffer buf-C))
(default-regexp (eval ediff-default-filtering-regexp))
f)
(list (setq f (read-directory-name
- "Directory A to compare:" dir-A nil 'must-match))
- (read-directory-name "Directory B to compare:"
+ "Directory A to compare: " dir-A nil 'must-match))
+ (read-directory-name "Directory B to compare: "
(if ediff-use-last-dir
ediff-last-dir-B
(ediff-strip-last-dir f))
(ediff-with-current-buffer buffer-B
(setq beg-B (move-marker (make-marker) beg-B)
end-B (move-marker (make-marker) end-B)))
-
+
;; make file-A
(if word-mode
(ediff-wordify beg-A end-A buffer-A tmp-buffer)
(ediff-wordify beg-B end-B buffer-B tmp-buffer)
(ediff-copy-to-buffer beg-B end-B buffer-B tmp-buffer))
(setq file-B (ediff-make-temp-file tmp-buffer "regB"))
-
+
(setq overl-A (ediff-make-bullet-proof-overlay beg-A end-A buffer-A))
(setq overl-B (ediff-make-bullet-proof-overlay beg-B end-B buffer-B))
(ediff-setup buffer-A file-A