Search in SVN repository for a file name

前端 未结 8 644
眼角桃花
眼角桃花 2020-12-23 10:57

We have a bulk repository for code contain thousands of folder and sub folder, i want to search under this repositor with file name or with some word.

Root f         


        
相关标签:
8条回答
  • 2020-12-23 11:27

    Recently I've published my utility to list the repository, that's much faster than "svn ls --depth infinity" approach. Here're the benchmarks. It just calls a function that is available in Subversion internal API, but now accessible through a command line.

    So you can run

    $ svn-crawler <URL> | grep "<file_pattern>"
    
    0 讨论(0)
  • 2020-12-23 11:35

    If the file is in your working copy, then if you are using svn 1.5:

    svn list --depth infinity | grep <filename>
    

    or an earlier version of svn:

    find . -name <filename> -not -path '*.svn*'
    

    If you need to find the file in history (deleted or moved):

    svn log -v | less
    

    and search for it with:

    \<filename><return>
    
    0 讨论(0)
  • 2020-12-23 11:35

    The following works for me (svn version 1.4.6)

    svn list -R <URL> | grep "<file_pattern>"
    
    0 讨论(0)
  • 2020-12-23 11:37

    If you are using TortoiseSVN you can try this IF you are willing to look Project by Project - works for me:

    1. Create a blank project under your repository top level URL, call it BLANK
    2. Click on the Repo URL on left pane
    3. On the right hand pane select your BLANK project and your desired project - say trunk
    4. Right click to pop up the browser menu and select 'Compare URLs', depending on the size of your repo it may take a minute to load. But you basically get your entire project list in a 'ready-to-search' list.
    5. Enter your file name or other string in the search filter
    0 讨论(0)
  • 2020-12-23 11:43

    svn list --depth infinity <your-repo-here> to get a list of files in the repo, and then svn cat to get contents. You can add --xml key to list command to make parsing a bit simpler.

    0 讨论(0)
  • 2020-12-23 11:43

    If your's remote repository is not huge, then an easy method is: You can do a "checkout" to get a local repository. If you are in windows machine you use "Search" or Linux machine use "Find" command.

    0 讨论(0)
提交回复
热议问题