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

Re: doing a diff between the trunk and a tag

From: Wesley J Landaker <wjl_at_icecavern.net>
Date: 2003-08-20 01:20:45 CEST

On Tuesday 19 August 2003 3:54 am, John Szakmeister wrote:
> On Monday 18 August 2003 23:22, Wesley J Landaker wrote:
> > There is one thing that came up a bunch today a few times while I
> > was trying to view some changes between various tags, and I wonder
> > if there is a good way to do it that I'm missing:
> >
> > In CVS, if I had TAG1 and TAG2, and I wanted to see what changed
> > between them, I'd say:
> >
> > cvs diff -rTAG1 -rTAG2
> >
> > So in subversion, if I have:
> >
> > /trunk
> > /branch/tag1
> > /branch/tag2
> >
> > I basically wanted to do:
> >
> > svn diff --old branch/tag1 --new branch/tag2
> It appears that the way you typed this that branch/tag1 and
> branch/tag2 are in your working copy. That's probably not the case.

No, I really do have them all in my working copy. I use branches and
tags *reeeeallly* heavily in some projects, so I'll often check out my
working directory from the repository root.

> You could do this though:
> svn diff --old=http://my.svnrepo.com/branch/tag1 \
> --new=http://my.svnrepo.com/branch/tag2
> This would perform a diff between HEAD revisions of each branch in
> the repo.

This does work, why doesn't this work giving working copies instead?

Take this tiny example:

$ svn info
Url: file:///tmp/repos
Revision: 0
Node Kind: directory
Schedule: normal

$ ls
branch/ trunk/

$ ls branch
tag1/ tag2/

$ svn diff --old=file:///tmp/repos/branch/tag1

(that works)

$ svn diff --old=branch/tag1 --new=branch/tag2
svn: Incorrect parameters given
svn: Sorry, svn_client_diff was called in a way that is not yet
svn: do_diff: paths aren't equal!

(that doesn't work!)

It seems like it should, because of the following from 'svn diff

diff (di): display the differences between two paths.
usage: 1. diff [-r N[:M]] [--old OLD-TGT] [--new NEW-TGT] [PATH ...]
       2. diff -r N:M URL
       3. diff [-r N[:M]] URL1[@N] URL2[@M]

  1. Display the differences between OLD-TGT and NEW-TGT. PATHs, if
     given, are relative to OLD-TGT and NEW-TGT and restrict the output
     to differences for those paths. ***OLD-TGT and NEW-TGT may be
     working copy paths or URL[@REV].*** (emphasis mine)

     OLD-TGT defaults to the path '.' and NEW-TGT defaults to OLD-TGT.
     N defaults to "BASE" or, if OLD-TGT is an URL, to "HEAD".
     M defaults to the current working version or, if NEW-TGT is an URL,
     to "HEAD".

     '-r N' sets the revision of OLD-TGT to N, '-r N:M' also sets the
     revision of NEW-TGT to M.

In #1, this seems to say pretty clearly that it can be a URL or a
working version. Maybe this is a bug or a "wishlist" kind of feature,
but it seems like the documentation supports this format.

Anyway, thanks for the message. I can at least do what I need to with
the longer URI format, but it seems like it should work this other way
as well, since I have all the branches checked out.

Wesley J. Landaker - wjl@icecavern.net
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2

  • application/pgp-signature attachment: signature
Received on Wed Aug 20 01:22:28 2003

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