How can I query my subversion repository?

后端 未结 10 703
谎友^
谎友^ 2021-01-31 05:08

Currently I would simply like to find all files that have not been modified in the last X days but ultimately I would like to be able to make more complex queries against my sub

相关标签:
10条回答
  • 2021-01-31 06:01

    Since 1.7 SVN, the working copy has a wc.db file in the .svn directory. It is a basic sqlite database, so pretty easy to query.

    You should make sure your working copy is up-to-date. If you are doing anything more than a quick and simple select, it would be safer to copy the file rather than risk breaking it.

    The change date is based on the unix epoch. For example:

    sqlite3 .svn\wc.db "select changed_revision, datetime((changed_date/1000000),'unixepoch') changed_date, changed_author, repos_path from NODES"
    
    0 讨论(0)
  • 2021-01-31 06:02

    With Powershell you can do some nice querying on the log messages

    $data = [xml] (svn log -r "r1:r2" --xml)
    $data.log.logentry | where-object {$_.message -match "regex"}
    

    Or even on the files changed (with some required magic to avoid a well-known powershell issue)

    $diff = [xml] (svn diff -r "r1:r2" --xml --summarize | %{$_ -replace "item", "item1"})
    $diff.diff.paths.path | where-object {$_.item1 -eq "file"}
    
    0 讨论(0)
  • 2021-01-31 06:05

    As already mentioned, svn log/info can be combined with shell commands to find what you want. Alternatively, you could directly use SVN's own API in C/C++ to programmtically process repository enties. SVN has Python bindings. If Java is your language of choice, try http://svnkit.com/

    0 讨论(0)
  • 2021-01-31 06:08

    You may want to checkout VoilàSVN or OpenGrok

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