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

Re: diff / log ... improvment for the -r switch

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-02-24 14:35:40 CET

On Feb 24, 2005, at 3:17 AM, Clemens Schwaighofer wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I would love to see the -r flag more usable for me. As subversion uses
> global revision numbers, mine can be very "cheesy" which means they
> have
> huge gaps in between, as I have a lot of different projects in my
> repository.
>
> So now I would love to see the diff for a file for the last X changes.
> Of course I don't know which rev was the working copy - X, so I have to
> search through the logs, count down to X and then make a -r with the
> right number.
>
> I would love to see a wy to say
>
> $> svn diff -r HEAD-5 foo.c
>
> so I can say, show me the diff from 5 commits before the current
> checked
> out working copy of 'foo.c'. The same would be great for log too. Or I
> want to know the latest committed and 5 before that, what cahnges
>
> $> svn diff -r HEAD-5:HEAD foo.c
>
> wouldn't that be great?

Yes, it's been discussed many times on the dev@ list. Nobody's ever
bothered to implement it yet.

>
> One more thing:
>
> I really have _no_ idea what the difference between HEAD, BASE and
> COMMITTED is. Especially BASE and COMITTED.
> HEAD is the latest in the rep. but the other toos. the explenation just
> doesn't make any sense to me ...
>

I'm looking at
http://svnbook.red-bean.com/en/1.1/ch03s03.html#svn-ch-3-sect-3.2.

BASE means, "the file's revision in your working copy". If you run
'svn info foo.c', that's the number you'll see. 'svn status -v' also
shows that in the first revision column.

COMMITTED means, "the last changed revision" of the file. There's even
a $LastChangedRev$ keyword for this. 'svn status -v' shows it in the
second revision column.

Here's a real simple example. You checkout a working copy of r5, so
everything in the working copy is at r5. Now your friend commits a
change to foo.c in r6. You update again, and now your whole working
copy is at r6. That is, every file has a BASE revision of 6. If you
look at foo.c, it's 'last changed revision" (COMMITTED) is r6. But the
other files all have different 'last changed revisions'... things less
than 6.

PREV is just defined to be COMMITTED-1. Which means at any time, 'svn
diff -rPREV:COMMITTED foo.c' will show the last change somebody made to
the file.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 24 14:37:58 2005

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

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