[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: creating patch of moved file fails

From: Stefan Sperling <stsp_at_elego.de>
Date: Wed, 15 Jul 2009 15:26:52 +0100

On Wed, Jul 15, 2009 at 08:22:46AM -0500, Peter Samuelson wrote:
> [Stefan Küng]
> > $ svn mv testwc\file.txt testwc\file2.txt
> > $ svn diff testwc > patch.txt
> >
> > now patch.txt only contains the deletion of file.txt, but not the add
> > of file2.txt.
> That is how 'diff' has always worked, isn't it? I believe the reason
> is that it is more useful to show the diff of the file contents, rather
> than just depicting the whole new file. Of course this means if you
> did not edit the file after the 'svn cp' or 'svn mv', there will be
> nothing in the diff.

I'm not sure if this was a deliberate design decision, or simply an
oversight in the implementation of svn diff. svn diff compares the
text base with the working file. In case of a copied file, the copied
file will have no changes WRT its text base, since the text base
and the working file are identical.

> There is also a --no-diff-deleted to make the 'svn mv' case more symmetric.

But IIRC there's no way to force svn diff to show files added with
history. And there's another inconsistency: Files added without
history are shown by svn diff.

There seem to be a couple of issues filed for this problem, some
linked to one another. The ones I found which look at least
related are:

Received on 2009-07-15 16:27:18 CEST

This is an archived mail posted to the Subversion Dev mailing list.