You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Dennis Jones <su...@grassvalleysoftware.com> on 2009/08/04 04:23:07 UTC
Getting the first revision
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?
Thanks,
- Dennis
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2379849
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
Re: Getting the first revision
Posted by Hari Kodungallur <hk...@gmail.com>.
On Mon, Aug 3, 2009 at 9:23 PM, Dennis Jones <
support@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@subversion.tigris.org].
Re: Getting the first revision
Posted by Dennis Jones <dj...@grassvalleysoftware.com>.
"Dennis Jones" <su...@grassvalleysoftware.com> wrote in message
news:h58d3g$300$2@ger.gmane.org...
>
> I'm looking for a *quick* way to get the first revision number from a
> specific repository path.
Thanks to both who replied. Reversing the order of the log output works
quite well. It's not as fast as getting the last rev, but it's a whole lot
faster than the way I was doing it before!
Thanks!
- Dennis
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2380060
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
RE: Getting the first revision
Posted by Bert Huijben <rh...@sharpsvn.net>.
> -----Original Message-----
> From: news [mailto:news@ger.gmane.org] On Behalf Of Dennis Jones
> Sent: dinsdag 4 augustus 2009 6:23
> To: users@subversion.tigris.org
> Subject: Getting the first revision
>
> 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>
svn log -r 1:HEAD --limit 1 --quiet <repourl>
(In some cases adding --stop-on-copy might be usefull)
Bert
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2379948
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].