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

RE: Efficient way to get the previous revision number

From: Giulio Troccoli <Giulio.Troccoli_at_uk.linedata.com>
Date: Tue, 6 May 2008 09:44:20 +0100

Sorry I was not very clear.

When I say that --limit doesn't work, I meant because I used it as in

svn log [dir1 URL] --limit 1

without specifying the revision range. I didn't think about using peg
revisions. I haven't tried it yet, but since revision 103 changed
nothing in dir1, wouldn't [dir1 URL]@103 throw up an error? After all if
I do

svn log -r 103

I simply get a line of hyphens.

My concern was about the use of a huge revision range, so effectively
getting the log for revision that I won't need. I guess using the
--limit option with a revision range will not do anything about the
efficiency. Instead the work done at the moment by head and tail is done
by Subversion on the server (because of --limit), which make things
simpler but maybe not more efficient.

>
 
 
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
 
-----Original Message-----
 

> From: Reedick, Andrew [mailto:jr9445_at_ATT.COM]
> Sent: 02 May 2008 18:01
> To: Giulio Troccoli; users_at_subversion.tigris.org
> Subject: RE: Efficient way to get the previous revision number
>
>
>
> > -----Original Message-----
> > From: Giulio Troccoli [mailto:Giulio.Troccoli_at_uk.linedata.com]
> > Sent: Friday, May 02, 2008 10:10 AM
> > To: users_at_subversion.tigris.org
> > Subject: Efficient way to get the previous revision number
> >
> > Given a revision number I need to find out the revision of the
> previous
> > commit in a particular directory. For example, with revision 100 I
> > committed some change to src/dir1. Then, with revision 101 to 104 I
> > committed changes to src/dir2. Now, with revision 105 I committed
> > changes again in src/dir1. So given revision 103, and the directory
> > src/dir1 of course, I need to find the previous revision, i.e. 100.
> >
> > What I am doing at the moment is something like
> >
> > svn --quiet log [dir1 URL] 103:1 | head -2 | tail -1 | cut -d" " -f1
|
> > cut -dr -f2
> >
> > I thought about using the --limit option but that would give me 105
> (in
> > the example above) which is not what I'm after.
> >
> > My script works just fine, but I think that getting the log from
> > revision 1 is a bit too much, since I just need the last one.
> >
> > Does anybody think of a better, more efficient, way to achieve this?
> >
> > I'm using SVN 1.4.4 and ksh for the script.
> >
>
> --limit does work. (I'm using 1.4.5.)
> svn log -q -r 103:1 --limit 1 URL | ...
>
> Using a peg revision should also work:
> svn log -q --limit 1 URL_at_103 | ...
>
>
> > I thought about using the --limit option but that would give me 105
> (in
> > the example above) which is not what I'm after.
>
> It should give you 100, not 105. Svn log goes down, not up.
>
>
>
>
> *****
>
> The information transmitted is intended only for the person or entity
to
> which it is addressed and may contain confidential, proprietary,
and/or
> privileged material. Any review, retransmission, dissemination or
other
> use of, or taking of any action in reliance upon this information by
> persons or entities other than the intended recipient is prohibited.
If
> you received this in error, please contact the sender and delete the
> material from all computers. GA625
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-05-06 10:44:05 CEST

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.