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

Show textual diff in a moved/copied file - how?

From: Alexey Neyman <stilor_at_att.net>
Date: Sun, 25 Feb 2018 23:38:03 -0800

Hi all,

I am trying to dig for some changes in a file that was moved a few times
and 'svn diff' shows full "remove old location and add new location as
if it were a new file" diffs, which are not helpful. Is there a way to
make the diff show the changes as compared against the origin of the
copy? I tried --notice-ancestry, does not help.

I have a vague recollection that 'svn diff' used to show the changes in
such copied files before - but I tried the small reproduction script
below and it shows the same, both with 1.7.22/1.8.17/1.9.7/trunk:

---8<---
#!/bin/bash

rm -rf /tmp/foo-{svn,wc}
svnadmin create /tmp/foo-svn
svn co file:///tmp/foo-svn foo-wc
cd foo-wc
echo foo > foobar
svn add foobar
svn ci -m "1"
svn mv foobar barfoo
echo bar >> barfoo
svn ci -m "2"
svn up
svn diff -c 2
svn --version
---8<---

Diff output:

---8<---
Index: foobar
===================================================================
--- foobar    (revision 1)
+++ foobar    (nonexistent)
@@ -1 +0,0 @@
-foo
Index: barfoo
===================================================================
--- barfoo    (nonexistent)
+++ barfoo    (revision 2)
@@ -0,0 +1,2 @@
+foo
+bar
---8<----

Regards,
Alexey.
Received on 2018-02-26 08:38:20 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.