On Tue, Apr 21, 2009 at 07:30, Craig <supkichen_at_gmail.com> wrote:
> Hi all,
> I was trying to create a patch to send to someone the other day, and
> ran into an interesting problem. I had "svn mv"ed a file, and changed
> a few others, then used TortoiseSVN to create the patch. All of the
> changes were included in the patch except the newly added file
> resulting from the move. The end result is that the patch did not
> represent all of the changes in the working copy, and hence was not
> very useful. The same thing happened with "svn diff".
> Any ideas?
A patch can't represent moves. The best it could do is representing
deletion of all lines from the file under its old name long with
insertion of all lines into the file under its new name.
$ cp design.txt added.txt
$ svn add added.txt
$ svn cp design.txt copied.txt
$ svn mv design.txt moved.txt
When I svn mv a file, diff on the *uncommitted* working copy shows the
deletion of the fille (well, it's contents) under the old name (this
can be turned off with the option --no-diff-deleted), but does not
show creation of the file under its new name (and I find no option to
turn this on).
If I *commit* the local changes first and then ask for a diff of that
change, then all the changes show up. (but applying this as a patch to
a working copy would lose the historical connection between design.txt
$ svn ci -m "moves, adds, and deletes"
Transmitting file data .
Committed revision 215.
$ svn diff -c215 | diffstat
added.txt | 20 ++++++++++++++++++++
copied.txt | 20 ++++++++++++++++++++
design.txt | 20 --------------------
moved.txt | 20 ++++++++++++++++++++
So to summarize:
You're right, svn diff is a little strange.
However, it still couldn't accurately represent svn mv and svn cp even
if it wasn't "strange".
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-04-21 17:32:44 CEST