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

Re: svn diff - Is this behaviour expected?

From: Vincent Lefevre <vincent-svn_at_vinc17.net>
Date: Mon, 16 Aug 2010 01:50:20 +0200

On 2010-08-15 05:34:08 -0700, Bert Huijben wrote:
> > Conversely, when blah has been added, but not committed,
> >
> > svn diff -rBASE blah
> >
> > gives a diff instead of an error (indeed an error is expected because
> > blah_at_BASE doesn't exist, as this can been seen with "svn cat blah").
> If I remember correctly comparing to BASE does not compare to the version in
> the repository, but to the local pristine version. Just like not providing
> -rBASE. (Compare it to -r<revision of base>).

??? I've never said anything different. I think you missed the point
that there is no local pristine version here, since "blah" hasn't
been committed yet.

BTW, the local pristine version does correspond to some revision
in the repository. It shouldn't be mixed up with the working copy

> We can't break this common use case without breaking almost every user of
> the local diff feature.

In any case the current behavior is buggy and needs to be changed
in some way, and the book needs to be updated accordingly:

prunille:~/wd> echo blah > blah
prunille:~/wd> svn add blah
A blah
prunille:~/wd> svn diff blah
Index: blah
--- blah (revision 0)
+++ blah (revision 0)
@@ -0,0 +1 @@

If the same revision 0 is compared, there shouldn't be any diff!
The diff contents are expected, but not the revision information.

> svn cat uses a different definition.

Necessarily. "svn diff" has a pair of targets, while "svn cat" has
only one. So, you can't have the same definition. :) That's why
"svn diff" has its own description concerning the revisions in the
Subversion book.

Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
Received on 2010-08-16 01:51:01 CEST

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

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