svn diff doesn't show the difference for files moved or copied

1,435 views
Skip to first unread message

Jothiram

unread,
Jan 6, 2009, 2:55:01 PM1/6/09
to reviewboard
Hello,

I'm using ReviewBoard (in Linux) with SVN. I'm using post-review.py to
post the changes.

For example consider a case where I added (svn add) a new Makefile,
deleted (svn del) a .c file and moved (svn mv) a python script from a
different folder to the current folder. svn status shows the following
list

A + python.py
D api/test.c
A Makefile

Note that the file (.py) is marked with '+' history scheduled to
commit. Using svn diff on this scenario shows the modifications for
the files test.c and Makefile. But the moved file is not shown by svn
diff.

post-review.py has function handle_renames in SVNClient. The comment
of this function says

"""
The output of svn diff is incorrect when the file in question
came
into being via svn mv/cp. Although the patch for these files
are
relative to its parent, the diff header doesn't reflect this.
This function fixes the relevant section headers of the patch
to
portray this relationship.
"""

Inside this function they check for the "Copied From URL" tag which is
available in the svn info of the moved or copied files. But this
handle_renames is called with the diff content and diff content
(generated by svn diff) doesn't have the moved/copied files listed!?

Am I missing something or how does this work?

How do make the diff content (using svn diff) to generate the
difference for the moved or copied files.

Thank you very much,
Jothiram

Russell Bryant

unread,
Jan 7, 2009, 11:12:47 PM1/7/09
to revie...@googlegroups.com
On Tue, Jan 6, 2009 at 1:55 PM, Jothiram <jothi...@gmail.com> wrote:
How do make the diff content (using svn diff) to generate the
difference for the moved or copied files.

As far as I know, you can't.  This is just how svn works ...

As a workaround, you can do this in a working copy to get it to show up in the diff, and then post-review will get it:

$ svn revert copied_file
$ svn add copied_file

--
Russell Bryant

Reply all
Reply to author
Forward
0 new messages