You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Simon Brunning <si...@brunningonline.net> on 2009/04/02 10:56:22 UTC

Creating patches - svn diff and moved files

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.

Is there a way to make svn diff include moved files? If not, what's
the recommended way to generate patches?

-- 
Cheers,
Simon B.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1517464

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: Creating patches - svn diff and moved files

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Apr 03, 2009 at 10:34:27AM +0100, Simon Brunning wrote:
> 2009/4/2 Simon Brunning <si...@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.

Stefan

Re: Creating patches - svn diff and moved files

Posted by Simon Brunning <si...@brunningonline.net>.
2009/4/2 Simon Brunning <si...@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.
>
> 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.

-- 
Cheers,
Simon B.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1530648

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: Creating patches - svn diff and moved files

Posted by Andrey Repin <an...@freemail.ru>.
Greetings, Simon Brunning!

SB> I've been using svn diff to generate patches, but I've noticed a
SB> problem. If I move a file using svn mv, the new version of the file
SB> isn’t included in the output of svn diff.

SB> Is there a way to make svn diff include moved files? If not, what's
SB> the recommended way to generate patches?

--notice-anchestry ? Although i'm having a bit of headache and can't
understand text in foreign languages very well. Sorry if I misunderstood your
post.


--
WBR,
 Andrey Repin (anrdaemon@freemail.ru) 02.04.2009, <21:19>

Sorry for my terrible english...

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1521504

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].