如何列出所有提交到存储库的文件?
我如何让 SVN 列出曾经提交到存储库的所有文件(如果可能,以及位置和修订版本)。
更准确地说:我需要所有曾经存在的路径。
如果有人知道如何对整个存储库(包括所有修订版)进行全文搜索,这会对我有更好的帮助。
示例
假设我提交了一个文件 SomeFileOne.txt
,稍后将其重命名为 SomeFileTwo.txt
。
执行所需的任务(我正在寻找的解决方案)后,我不仅应该获得 SomeFileTwo.txt
,而且还应该获得 SomeFileOne.txt
。
...
/trunk/SomeProject/SomeFileOne.txt - revision 100
/trunk/SomeProject/SomeFileTwo.txt - revision 101
...
How could I let SVN list all files which were ever committed to a repository (if possible, along with location and revision).
More exactly: I need all ever existed paths.
If someone knows how to do a fulltext search on the entire repository (including all revisions), this would help me even better.
Example
Let's say I commit a file SomeFileOne.txt
, later rename it to SomeFileTwo.txt
.
After performing the required task (for which solution I'm looking for), I should get not only SomeFileTwo.txt
, but also SomeFileOne.txt
.
...
/trunk/SomeProject/SomeFileOne.txt - revision 100
/trunk/SomeProject/SomeFileTwo.txt - revision 101
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
通过玩发现了一些东西。
一个缓慢而肮脏的解决方案可能是:
输出看起来像:
嗯,至少它解决了我的问题。
注意:显示
转储修订版...
,因为它是stderr
。Found out something by playing around.
A slow-and-dirty solution might be:
Output looks like:
Well, at least it solves my problem.
NOTE:
Dumped revision ...
is shown, because it'sstderr
.要获得 svn log -v 的改进、结构化输出,请使用以下 bash 脚本:
解释:
这也适用于结帐的子路径,您甚至根本不需要结帐,如果您提供存储库路径:
结果:
正确,文件列表可能还不适合自动处理,但如果我可以这么说的话,它距离日志输出还有很长的路要走。享受。
For an improved, structured output to svn log -v, use the following bash script:
Explained:
This also works for subpaths of the checkout, you don't even need a checkout at all, if you provide the repository path:
Result:
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.
对我来说, svn log -v 是一种更直观的方法 - 或者您已经尝试过吗?是否可以分享对存储库中所有文件提交的如此广泛的报告的需求?
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?
如果您只是想浏览一下,您可以使用 svn Web 访问工具之一获得您想要的内容。综述写在这里。
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.