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

[PATCH] (Issue 1213) svn cmd -r PREVn:HEAD <file>

From: Sir Woody Hackswell <sir.woody_at_hackswell.com>
Date: 2003-10-23 21:51:54 CEST

Hello all!

Here's my first attempt at a PREVn patch. It's slow and inefficient, but it
works. :) The patch is against rev 7504. It was gratuitously copied and
enhanced from Mark Grosberg's patch in issue #1213. :)

PREVn should be defined as 'n' revisions before COMMITTED. PREV and
PREV1 are LOGICALLY the same, but PREV (as per previous behavior) was
COMMITTED-1, where PREV1 is the actual previous commit.

Details, caveats, and suckage:

To get a file's revision numbers, I call ra_lib->get_log(), with a start
revision of COMMITTED, and an end revision of 1. THIS SUCKS, but works.

I would like to propose a new ra_lib function or a modification of
get_log(). The new function would be get_revisions(), but would do basically
the same thing as get_log(), but without throwing as much data around.
 
In either case, get_log() or get_revisions() would take a start revision, an
end revision, and a count as to how many to go back at maximum (0 for going
all the way to the end). This way you can short-circuit out of the call if
you don't need ALL the revisions.

Runtime Examples:
[woody@sir trunk]$ svn diff -r PREV:COMMITTED COPYING
Index: COPYING
===================================================================
--- COPYING (revision 6226) // Note PREV is COMMITTED-1
+++ COPYING (revision 6227)
<<SNIP>>

[woody@sir trunk]$ svn diff -r PREV1:COMMITTED COPYING
Index: COPYING
===================================================================
--- COPYING (revision 4371) // Note this is the actual previous commit
+++ COPYING (revision 6227)
<<SNIP>>

[woody@sir trunk]$ svn diff -r PREV4:PREV2 COPYING
Index: COPYING
===================================================================
--- COPYING (revision 1219)
+++ COPYING (revision 4233)
<<SNIP>>

-Richard Balint

-----
./configure --prefix=/dev/mocha --enable-caffeine --enable-sugar

Sir.Woody_at_Hackswell.com http://sir.woody.hackswell.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Thu Oct 23 21:55:13 2003

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.