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

Re: Query on files managed by SVN

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: Thu, 3 Apr 2008 15:37:19 -0700

On Thu, Apr 3, 2008 at 10:17 AM, <Gabriel.SCOLAN_at_messier-bugatti.com> wrote:

>
> Hi there,
>
> I was wondering how it is possible to search in the repository to locate a
> specific file, returning for example the revision of the repository when the
> last modification of the file was committed and its path in the repository:
> "myrepos-1234:/path/to/file"
> I'm supprised not to have found a command line like "svn query" or "svn
> find".
>
> Where did I miss something ?
>
>
No, I don't think there is a specific command to find a file, assuming you
are searching for a file and you don't know the path within the repository
where this file exists.

If you know the path to the file, "svn log --limit 1 /path/to/file" will
give you the result.

Assuming you don't know the path, you could do one of the following:

1. Search through logs to find the path ("svn log -v /url/to/repo | grep
filename$" etc..)

2. If you have access to the server, you can run the 'svnlook' command to
find the location of the file: for example:

   $ svnlook tree /path/to/repos --full-paths | grep "Foo.java$"

You can also supply another parmeter to svnlook to limit your search to a
particular tree (trunk for example):

     $ svnlook tree /path/to/repos trunk/subdir1 --full-paths | grep
"Foo.java$"

Once you know the location of the file in the repository, "svn log --limit 1
/path/to/file" from the client will give you the latest revision.

OR - You could install ViewVC with query capability on the server and it
gives you a powerful web based query form where you can do fancy stuff like
this.

regards,
-Hari
Received on 2008-04-04 00:37:42 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.