On 5/12/14, 2:36 PM, Dan Ellis wrote:
> I'm trying to diff the contents between of a local working copy file to a file
> in the repository (I really just need a yes/no answer).  This file happens to
> be identical in content, but they do not share the same ancestry (unrelated 
> nodes).
> 
> When I do a diff with no --summarize option, I get what I expect, namely no 
> output:
> 
> c:\Project_files\sandbox>svn diff --ignore-properties
> --old="c:\project_files\sandbox_v2\AAAA.txt" 
> --new="http://svr/repo/foo.txt@3813";
> c:\Project_files\sandbox>
> 
> When I add the --summarize argument to the command line, I get the following:
> c:\Project_files\sandbox>svn diff --ignore-properties
> --old="c:\project_files\sandbox\AAAA.txt" 
> --new="http://svr/repo/AAAA.txt@3813";
> --summarize
> D       C:\project_files\sandbox\AAAA.txt
> A       C:\project_files\sandbox\AAAA.txt
> 
> From reading http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.diff.html, it
> looks like the behavior I'm seeing is similar to the --notice-ancestry flag:
> 
> "By default, svn diff ignores the ancestry of files and merely compares the
> contents of the two files being compared. If you use --notice-ancestry, the
> ancestry of the paths in question will be taken into consideration when
> comparing revisions (i.e., if you run svn diff on two files with identical
> contents but different ancestry, you will see the entire contents of the file
> as having been removed and added again)."
> 
> How can I get the --summarize behavior to only look at file contents?  I fee
> like I might be missing something obvious.

I suspect you're using 1.7.x or older.  The summarize feature was entirely
rewritten in 1.8.x and works for the scenario you describe.  We know that
--summarize has issues in 1.7.x and older (and I spent a lot of effort trying
to fix some of the cases).

Example using 1.8.9 (this isn't out yet but it should work in 1.8.8):

$ svnadmin-1.8 create repo8
$ svn-1.8 co file://$PWD/repo8 wc8
Checked out revision 0.
$ cd wc8
$ echo something > foo
$ svn-1.8 add foo
A         foo
$ svn-1.8 ci -mm
Adding         foo
Transmitting file data .
Committed revision 1.
$ svn-1.8 rm foo
D         foo
$ echo something > foo
$ svn-1.8 add foo
A         foo
$ svn-1.8 diff foo
$ svn-1.8 diff --summarize foo
$ svn-1.8 diff --summarize --notice-ancestry foo
D       foo
A       foo

One thing you may notice is I don't have to use --new and --old because 1.8 can
do summarize against paths just within the working copy now (I'm guessing that
your --old is your BASE for your wc).

So I suggest that you upgrade to 1.8.x.

Reply via email to