subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Sperling <s...@elego.de>
Subject Re: Is it possible to see a diff of a "replaced" file?
Date Tue, 10 Sep 2013 15:10:32 GMT
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

Mime
View raw message