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

Re: Is it possible to see a diff of a "replaced" file?

From: Stefan Sperling <stsp_at_elego.de>
Date: Tue, 10 Sep 2013 17:10:32 +0200

On Tue, Sep 10, 2013 at 09:59:27AM -0500, Benjamin Fritz wrote:
> I'm referring to files with an 'R' status in 'svn log'.
>
> I want to see the changes between the new file, and the file that it replaced.

'svn diff' does that by default. You have to use the --notice-ancestry
option to force svn not to show a diff between post-replaced and pre-replaced.

So I wonder why you aren't seeing the expected behaviour.
Maybe your Subversion client (Tortoise) sets the notice-ancestry
flag by default?

$ svn cat alpha
alpha
$ svn rm alpha
D alpha
$ echo foo > alpha
$ svn add alpha
A alpha
$ svn st alpha
R alpha
$ svn diff alpha
Index: alpha
===================================================================
--- alpha (revision 2)
+++ alpha (working copy)
@@ -1 +1 @@
-alpha
+foo
$ svn diff --notice-ancestry alpha
Index: alpha
===================================================================
--- alpha (revision 0)
+++ alpha (working copy)
@@ -1 +0,0 @@
-alpha
Index: alpha
===================================================================
--- alpha (revision 0)
+++ alpha (working copy)
@@ -0,0 +1 @@
+foo
$ svn commit -mm
Replacing alpha
Transmitting file data .
Committed revision 3.
$ svn log -v -r3
------------------------------------------------------------------------
r3 | stsp | 2013-09-10 17:08:14 +0200 (Tue, 10 Sep 2013) | 1 line
Changed paths:
   R /trunk/alpha

m
------------------------------------------------------------------------
$ svn diff -c3 ^/trunk
Index: alpha
===================================================================
--- alpha (revision 2)
+++ alpha (revision 3)
@@ -1 +1 @@
-alpha
+foo
$ svn diff -c3 --notice-ancestry ^/trunk
Index: alpha
===================================================================
--- alpha (revision 2)
+++ alpha (revision 3)
@@ -1 +0,0 @@
-alpha
Index: alpha
===================================================================
--- alpha (revision 0)
+++ alpha (revision 3)
@@ -0,0 +1 @@
+foo
Received on 2013-09-10 17:11:22 CEST

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.