unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* diff-mode and ediff-fixup-patch-map on patches with several directories
@ 2005-08-17 21:47 Bruce Stephens
  0 siblings, 0 replies; only message in thread
From: Bruce Stephens @ 2005-08-17 21:47 UTC (permalink / raw)


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).

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-17 21:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-17 21:47 diff-mode and ediff-fixup-patch-map on patches with several directories Bruce Stephens

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).