How do I list all files ever committed to the repository?

故事扮演 提交于 2019-12-04 09:49:55

To me, svn log -v would have been a more intuitive method - or have you already tried that ? Is it possible to share the need for requiring such an extensive report on all the file commits ever made in the repository?

Found out something by playing around.

A slow-and-dirty solution might be:

svnadmin dump MY_REPO | grep Node-path

Output looks like:

* Dumped revision 3039.
Node-path: trunk/proj1/src/p/keywords/main/NoOp.java
Node-path: trunk/proj1/src/p/keywords/main/ScopeDecl.java
* Dumped revision 3040.
Node-path: trunk/myCommons/src/i/IConverter.java
Node-path: trunk/myCommons/src/i/ListUtils.java
* Dumped revision 3041.
Node-path: trunk/proj1/src/p/execution/impl/IterativeExecuter.java
Node-path: trunk/proj1/src/p/keywords/DeclConstant.java

Well, at least it solves my problem.

NOTE: Dumped revision ... is shown, because it's stderr.

For an improved, structured output to svn log -v, use the following bash script:

$ svn log -v | egrep '^   A' | cut -c 6- | sort | uniq

Explained:

  • fetch the whole svn log of the given path
  • select only lines starting with ' A', which is the svn log output for an added file.
  • cut away the first 5 chars, which is the mentioned add info
  • sort the output
  • remove duplicate lines (e.g. if a file was readded later)

This also works for subpaths of the checkout, you don't even need a checkout at all, if you provide the repository path:

$ svn log -v https://github.com/schacon/kidgloves/ | egrep '^   A' | cut -c 6- | sort | uniq

Result:

/branches
/branches/testing (from /trunk:17)
/trunk
/trunk/README
/trunk/example.rb
/trunk/kidgloves.rb
/trunk/simple_rack.rb

Right, the file list may not be perfect for automated processing yet, but it goes a long way from just the log output, if I may say so. Enjoy.

If you just want to browse around you might get what you want with one of the svn web access tools. A roundup was written up over here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!