emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

diff-mode and ediff-fixup-patch-map on patches with several directories


From: Bruce Stephens
Subject: diff-mode and ediff-fixup-patch-map on patches with several directories
Date: Wed, 17 Aug 2005 22:47:41 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Summary: it looks like ediff-fixup-patch-map is intended to be called
with ediff-patch-map containing changes of files all in the same
directory, and diff-mode is happy to call diff-ediff-patch (which
calls ediff-fixup-patch-map underneath) in cases where that's not so.

I created dir1 and dir2, with files dir1/file1 and dir2/file2, and
made a patch file changing both the files (with "diff -u" to get
unified diffs).  So the patch file looked like this (removing the
actual changes, which I think aren't relevant):

--- dir1/file1  2005-08-17 21:55:06.944770593 +0100
+++ dir1/file1  2005-08-17 21:55:27.884862605 +0100

--- dir2/file2  2005-08-17 21:55:42.836072304 +0100
+++ dir2/file2  2005-08-17 21:56:02.148468087 +0100

If I edit that in diff-mode, then everything's OK; in particular,
next-error-follow-minor-mode can find the two files to show me the
differences.

But diff-ediff-patch (M-A) doesn't work well.  I have to enter the
directory, which I can live with, although diff-mode's guess of the
current directory seems appropriate.  (It would be nice if there were
an entry point allowing elisp code to specify the correct directory, I
think, which I don't see.)

More worryingly, I get the message:

    The patch file contains a context diff for
        dir2/file2
        dir2/file2
    However, Ediff cannot infer the name of the actual file
    to be patched on your system.  If you know the correct file name,
    please enter it now.

    If you don't know and still would like to apply patches to
    other files, enter /dev/null

And I think that's a bug/limitation in ediff-fixup-patch-map: it sets
up base-dir1 and base-dir2 at the beginning, and they're both set to
<something>/dir1/ in this case, but then goes through both files, and
so ediff-file-sans-prefix fails to strip the directory from
dir2/file2.  

In short, it looks like ediff-fixup-patch-map is intended to be called
with ediff-patch-map containing changes of files all in the same
directory.

So is this really the case, or is diff-mode calling it strangely, or
what?  If that's the case, then that seems disappointing (I was
imagining using it on the output of "cvs diff" (or "svn diff", or
whatever), to remove changes I didn't want to commit right away, and
those will often cover several directories).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]