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

Re: diff between working copy dirs?

From: Stefan Sperling <stsp_at_elego.de>
Date: Tue, 13 Oct 2009 16:48:58 +0100

On Tue, Oct 13, 2009 at 10:12:47AM -0400, Mark J. Reed wrote:
> This seems like it should be a FAQ, but while I saw a few related posts in
> the archives, there didn't seem to be anything definitive. Apologies if I
> just missed it.
> Anyway, I'm trying to do e.g.
> svn diff branches/my_branch trunk
> But it always reports no differences (and no error message, either).
> Whereas if I try
> svn diff --old=branches/my_branch --new=trunk
> I get an error message about a usage that is "not yet supported".
> It seems that my options are limited to either using full repository URLs
> for both targets, or using a local shell diff (with appropriate flags to
> exclude the contents of the .svn directories). Is that correct?

It's not possible right now to compare 2 files in a working copy to each
other using svn diff. You can only compare a file in the working copy to
its BASE revision (i.e. what you have changed since you checked out that

You can compare 2 arbitrary repository locations, however.

> If so, what's the rationale for the limitation - potential confusion between
> the contents of the working directories and the contents of the
> corresponding repository URLs?

Probably lack of developer time and not enough users requesting that
this feature should be added. There is a comment above the code throwing
the error you are hitting which I've pasted below.


(from libsvn_client/diff.c)
/* A Theoretical Note From Ben, regarding do_diff().

   This function is really svn_client_diff5(). If you read the public
   API description for svn_client_diff5(), it sounds quite Grand. It
   sounds really generalized and abstract and beautiful: that it will
   diff any two paths, be they working-copy paths or URLs, at any two

   Now, the *reality* is that we have exactly three 'tools' for doing
   diffing, and thus this routine is built around the use of the three
   tools. Here they are, for clarity:

     - svn_wc_diff: assumes both paths are the same wcpath.
                     compares wcpath_at_BASE vs. wcpath_at_WORKING

     - svn_wc_get_diff_editor: compares some URL_at_REV vs. wcpath_at_WORKING

     - svn_client__get_diff_editor: compares some URL1_at_REV1 vs. URL2_at_REV2

   So the truth of the matter is, if the caller's arguments can't be
   pigeonholed into one of these three use-cases, we currently bail
   with a friendly apology.

   Perhaps someday a brave soul will truly make svn_client_diff5
   perfectly general. For now, we live with the 90% case. Certainly,
   the commandline client only calls this function in legal ways.
   When there are other users of svn_client.h, maybe this will become
   a more pressing issue.


To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-10-13 22:41:18 CEST

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