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

Re: Creating patches - svn diff and moved files

From: Stefan Sperling <stsp_at_elego.de>
Date: Fri, 3 Apr 2009 15:07:11 +0100

On Fri, Apr 03, 2009 at 10:34:27AM +0100, Simon Brunning wrote:
> 2009/4/2 Simon Brunning <simon_at_brunningonline.net>:
> > I've been using svn diff to generate patches, but I've noticed a
> > problem. If I move a file using svn mv, the new version of the file
> > isn???t included in the output of svn diff.

Files that are marked added-with-history are not included in the
output of svn diff. (Remember: the target of a 'move' is like a
target of a 'copy' which is like an 'add' with history. Yes, this
is confusing.)

I can only explain the technical reason why it happens but I don't
know the reasoning behind why Subversion was designed this way:

'svn diff' compares the working version with the text base it has
for the file (in .svn/text-base/). If you add a file with history
you get a new text base for it, and the content of the working file
will match the text base, hence you get no diff.

Note that the file shows up in the diff if you modify it after
moving it.

> > Is there a way to make svn diff include moved files? If not, what's
> > the recommended way to generate patches?
> I see I'm not alone in having this problem - see
> <http://tinyurl.com/4zphfa> and <http://tinyurl.com/dy8grw> - but I
> can't find a solution anywhere.
> Anyone know what happened to the svnpatch-diff branch at
> <http://tinyurl.com/chrlso>? It looks like this was intended to give
> svn the ability to take and apply patches including file moves and
> renames and property changes, which would be great. But sadly the
> branch appears moribund.

The branch has been merged into trunk. This functionality will
be in Subversion-1.7.

Received on 2009-04-03 16:08:09 CEST

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