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

Re: What is the latest revision without considering specific folder?

From: Mojca Miklavec <mojca.miklavec.lists_at_gmail.com>
Date: Mon, 16 Feb 2009 12:15:12 +0100

On Mon, Feb 16, 2009 at 03:25, Ryan Schmidt wrote:
> On Feb 15, 2009, at 04:20, Mojca Miklavec wrote:
>> I need to figure out the latest revision of some SVN repository that
>> has been done anywhere except in specific folder (or anywhere except
>> by specific user/or the latest revision done by specific user).
>> Let's say that I have repository "household":
>> household/README.txt
>> household/Makefile
>> household/room1/...
>> household/room2/...
>> ...
>> household/bathroom/...
>> household/trash/...
>> There are lots of changes in "trash" folder that I'm not interested in
>> (they are mostly commited by a limited number of users) and there are
>> rare, but important changes, usually done by a single user that can
>> appear anywhere but in trash (it could be a change in Makefile or a
>> change in any file inside any room).
>> I'm currently using
>> cd household && svn info | grep "Last Changed Rev:" | sed 's/^Last
>> Changed Rev: \(.*\)$/\1/' && cd ..
>> and whenever the version changes from last time, I need to start a
>> time-consuming task on computer. Contents of "trash" have no
>> influence, so I would like to ignore any changes done in trash (or
>> ignore any changes done by a limited number of users that commit
>> there).
>> My short question is: what's an easy way to determine the last change
>> done in any folder except in trash? I don't mind the form - it can be
>> some svn command or some loop in bash/sh, a combination of both, or
>> sometheing completely else.
>> I'm probably able to write some ruby program that loops over all the
>> files and calls svn info on every one of them and then compares
>> results, but I'm sure that there's some more elegant solution. I'm a
>> complete newbie in both svn and bash.
> Use "svn log -v -q" on the directory or URL in question. "-v" shows you
> files changed; "-q" doesn't print the log message. When you find the
> revision whose changed paths do not include "trash", you'll have your last
> changed revision.


I first wanted to loop through all the top-level folders and run svn
info on each one of them and then calculate the maximum revision.

I didn't take your idea literally (it can take a while for repository
with a long history, and it also takes some post-processing), but you
gave me the idea to construct the following one-liner:

version=`cd TRUNK && svn log -q -r HEAD:800 | grep theimportantuser |
head -n 1 | sed 's/^r\(\w*\).*/\1/' && cd .. `

Since there's a limited number of users commiting important changes
and a limited number of users commiting to folders I'm not interested
in, this happens to perfectly satisfy our needs.

Thanks again,


To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-02-16 16:20:59 CET

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.