]> git.eshelyaron.com Git - emacs.git/commitdiff
* vc/ediff.el (ediff-directories): Add trailing space to prompts.
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 16 Jul 2012 10:19:56 +0000 (12:19 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 16 Jul 2012 10:19:56 +0000 (12:19 +0200)
* vc/ediff-diff.el (ediff-same-file-contents): Handle the case,
when F1 and F2 are located on different hosts.

lisp/ChangeLog
lisp/vc/ediff-diff.el
lisp/vc/ediff.el

index 7bb09181b96f87539efd771af211c22473c59c68..929c810ed71143f4c5515651c5ac89234b071cac 100644 (file)
@@ -1,3 +1,10 @@
+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).
index 31a5436acd9bf2b63001aef5cf7bfb1281a60f22..5b31e625a009940bd322709afc606914f2a8c0b2 100644 (file)
@@ -1406,18 +1406,27 @@ arguments to `skip-chars-forward'."
   "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)
index a1f3b72942f61c90cf580270755e5213cac72a38..9a20afd90cbddb47d900290c1b915e0fb47ecaf6 100644 (file)
@@ -491,12 +491,12 @@ If this file is a backup, `ediff' it with its original."
              (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))
@@ -542,8 +542,8 @@ expression; only file names that match the regexp are considered."
         (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))
@@ -1072,7 +1072,7 @@ lines.  For small regions, use `ediff-regions-wordwise'."
          (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)
@@ -1084,7 +1084,7 @@ lines.  For small regions, use `ediff-regions-wordwise'."
              (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