You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Mark J. Reed" <ma...@gmail.com> on 2009/10/13 14:12:47 UTC
diff between working copy dirs?
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?
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?
It just seems like the sort of thing that "should work", but of course
that's easy to say from the perspective of someone who hasn't tried to
implement it.
Thanks.
--
Mark J. Reed <ma...@gmail.com>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2407108
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: diff between working copy dirs?
Posted by Les Mikesell <le...@gmail.com>.
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?
With the --old=... --new=... syntax you should be able to specify a
local directory in the working copy (like '.') for one argument and a
url for the other.
> 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?
It's probably unusual to have checked out the whole tree of
trunk/branches into the same working copy. Normally you'd just have one
instance that you might want to diff against other repository versions.
> It just seems like the sort of thing that "should work", but of course
> that's easy to say from the perspective of someone who hasn't tried to
> implement it.
If you are doing a strictly local diff, why use the svn tool at all?
--
Les Mikesell
lesmikesell@gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2407133
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: diff between working copy dirs?
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Oct 13, 2009, at 09:12, 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).
"svn diff a b" doesn't mean "compare a with b and show the
differences". It means "compare a with the repository location for a
and show the differences, and compare b with the repository location
for b and show the differences". And there aren't any so it doesn't
show anything.
> 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".
I haven't used the --old and --new flags so I'm not sure about this
usage.
> 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?
I think that's correct, those are your options.
> 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?
>
> It just seems like the sort of thing that "should work", but of
> course that's easy to say from the perspective of someone who hasn't
> tried to implement it.
I don't think of this as a limitation but rather you're just trying to
use "svn diff" for something it wasn't designed to do. It was designed
to do what I explained above.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2407140
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: diff between working copy dirs?
Posted by Stefan Sperling <st...@elego.de>.
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
file.)
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.
Stefan
(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
revisions.
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@BASE vs. wcpath@WORKING
- svn_wc_get_diff_editor: compares some URL@REV vs. wcpath@WORKING
- svn_client__get_diff_editor: compares some URL1@REV1 vs. URL2@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.
*/
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2407163
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].