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

Re: Getting the first revision

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: Mon, 3 Aug 2009 22:22:39 -0700

On Mon, Aug 3, 2009 at 9:23 PM, Dennis Jones <
support_at_grassvalleysoftware.com> wrote:

> Hi all,
>
> I'm looking for a *quick* way to get the first revision number from a
> specific repository path.
>
> I can get the *last* revision from a path via:
>
> svn log --quiet -l1 <repourl>
>
> . . . and then parsing the output with sed. This is very fast. However,
> the only way I have found to get the *first* revision is to capture a log
> of
> the entire history:
>
> r3 | djones | 2001-01-16 19:56:51 -0800 (Tue, 16 Jan 2001)
> ------------------------------------------------------------------------
> r2 | djones | 2000-11-29 17:22:29 -0800 (Wed, 29 Nov 2000)
> ------------------------------------------------------------------------
> r1 | (no author) | 2000-11-29 17:22:29 -0800 (Wed, 29 Nov 2000)
> ------------------------------------------------------------------------
>
> and then parse the last row for the revision number ("r1" in this case).
> But even with --quiet, this takes a long time, especially as the number of
> revisions increases in the repository over time. Can anyone suggest a
> faster way?
>
>

The following command will reverse the order of svn log
svn log -r 0:HEAD

Add your other parameters (-q and --limit 1) and you will get the first
revision.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2379859

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-08-04 07:23:38 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.