[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: Paul Koning <Paul_Koning_at_dell.com>
Date: Fri, 2 May 2008 10:12:59 -0400

>>>>> "Giulio" == Giulio Troccoli <Giulio.Troccoli_at_uk.linedata.com> writes:

 Giulio> Given a revision number I need to find out the revision of
 Giulio> the previous commit in a particular directory. For example,
 Giulio> with revision 100 I committed some change to src/dir1. Then,
 Giulio> with revision 101 to 104 I committed changes to
 Giulio> src/dir2. Now, with revision 105 I committed changes again in
 Giulio> src/dir1. So given revision 103, and the directory src/dir1
 Giulio> of course, I need to find the previous revision, i.e. 100.

 Giulio> What I am doing at the moment is something like

 Giulio> svn --quiet log [dir1 URL] 103:1 | head -2 | tail -1 | cut -d" " -f1 | cut -dr -f2

  svn --quiet log [dir1 URL] --limit 2 | head -4 | tail -1 | cut -d" " -f1 | cut -dr -f2

I'm curious why you want the previous rev number -- it seems like a
rather meaningless bit of data.


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-02 16:24:31 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.