使用 svn info 获取修订日期
我的目标是从存储库中提取彼此相隔至少 30 天的修订版本。假设我想检查从 30 到 100 的修订版。对于每个修订版,我使用了 SVN info
命令并使用最后更改的日期作为该修订版的日期。接下来的步骤很简单。检查两次连续修订之间的天数差异。
我的问题是该方法是否可以(或者以另一种方式,在该方法中获取修订日期是否正确)。任何建议都会有帮助。谢谢。
SVN 信息输出示例。
$ svn info -r 200 https://itextsharp.svn.sourceforge.net/svnroot/itextsharp/trunk
Path: trunk
URL: https://itextsharp.svn.sourceforge.net/svnroot/itextsharp/trunk
Repository Root: https://itextsharp.svn.sourceforge.net/svnroot/itextsharp
Repository UUID: da003780-e18d-4f51-86a4-c2ecb517afe5
Revision: 200
Node Kind: directory
Last Changed Author: psoares33
Last Changed Rev: 200
Last Changed Date: 2010-10-17 12:25:23 -0600 (Sun, 17 Oct 2010)
My objective is to extract revisions from the repository that are at least 30 days apart from each other. Lets say I want to examine revisions starting from 30 to 100. For each of the revisions, I have used SVN info
command and use the last changed date as the date of that revision. The next steps are straightforward. Check the difference in days between two consecutive revisions.
My question is whether the approach is ok (or in another way, is it correct to get the date of a revision in this approach). Any suggestion would be helpful. Thanks.
Example of SVN info output.
$ svn info -r 200 https://itextsharp.svn.sourceforge.net/svnroot/itextsharp/trunk
Path: trunk
URL: https://itextsharp.svn.sourceforge.net/svnroot/itextsharp/trunk
Repository Root: https://itextsharp.svn.sourceforge.net/svnroot/itextsharp
Repository UUID: da003780-e18d-4f51-86a4-c2ecb517afe5
Revision: 200
Node Kind: directory
Last Changed Author: psoares33
Last Changed Rev: 200
Last Changed Date: 2010-10-17 12:25:23 -0600 (Sun, 17 Oct 2010)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您最好使用
svn log
命令,并使用--xml
选项进行自动解析。这将为您提供一个快速的修订列表,包括日期。You are probably better off using the
svn log
command, with the--xml
option for automated parsing. This will give you a quick list of revisions, including the dates.svn log -r {DATESPEC}:{DATESPEC}/rev-id
效果会更好svn log -r {DATESPEC}:{DATESPEC}/rev-id
will work better