You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ga...@messier-bugatti.com on 2008/04/03 17:17:16 UTC

Query on files managed by SVN

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 ?

Thanks in advance for your help.

best regards,

Gabriel SCOLAN
--------------------------------------------------------------------------------------------
Messier-Bugatti - DE/TL
(+33) 1 46 29 28 09
Zone Aéronautique Louis Breguet - BP 40 - F-78141 Vélizy-Villacoublay
gabriel.scolan@messier-bugatti.com
--------------------------------------------------------------------------------------------

**********************************************************************
"Ce courriel et les documents qui sont attachés peuvent contenir des
informations confidentielles. Si vous n'êtes pas le destinataire escompté,
merci d'en informer l'expéditeur immédiatement et de détruire ce courriel
ainsi que tous les documents attachés de votre système informatique. Toute 
divulgation, distribution ou copie du présent courriel et des documents attachés
sans autorisation préalable de son émetteur est interdite."

"This e-mail and any attached documents may contain confidential or proprietary 
information. If you are not the intended recipient, please advise the sender immediately
and delete this e-mai land all attached documents from your computer system. Any 
unauthorised disclosure, distribution or copying hereof is prohibited."
**********************************************************************



Re: Query on files managed by SVN

Posted by Hari Kodungallur <hk...@gmail.com>.
On Thu, Apr 3, 2008 at 10:17 AM, <Ga...@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