Search in SVN repository for a file name

前端 未结 8 681
眼角桃花
眼角桃花 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:46

    With access to the repo itself use (i.e on your svn host file sytem)

    svnlook tree [path_to_repo] | grep [file_name]  
    

    or to search all repos (if you have mulitple repos setup).

    for i in \`ls [path_to_repos_dir]`; do echo $i; svnlook tree [path_to_repos_dir]/$i | grep -i [file_or_folder_name]; done 
    

    the option --full-paths will give the full path in repo to the file (if found)

    example:

    for i in `ls /u01/svn-1.6.17/repos`; do echo $i; svnlook tree --full-paths /u01/svn- 1.6.17/repos/$i | grep -i somefile.txt; done
    

    redirect output to a file if static copy is needed.
    assumes using nix OS.

提交回复
热议问题