如何获取特定日期或日期范围内的 SVN 修订号

问题描述:

如何获取某个日期某个分支的修订号.

How can I get the revision number of a branch on certain date.

我试过了:

svn checkout -r {2006-02-17}

但无法得到任何输出.

 svn co -r {2011-11-28} svn://location/of/my/repository/branch

对我有用.可能是您缺少 URL.但是,如果我尝试查看 repo 不存在的时间的修订版,我会得到

works for me. May be you are missing URL. however if I try to checkout a revision of a time when repo did not exist, I get

svn co -r {2006-11-28} svn://location/of/my/repository/branch
svn: Unable to find repository location for 'svn://location/of/my/repository/branch' in revision 0

更新阅读您的评论后,您似乎只对查看日期范围内的提交文件感兴趣.这是我所做的:


Update After reading your comment you seem to be just interested in seeing committed file in a date range. Here is what I do:

svn log -r {2011-12-02}
------------------------------------------------------------------------
r10514 | nishant | 2011-12-01 22:47:44 +0000 (Thu, 01 Dec 2011) | 1 line

fixed issue#2993
------------------------------------------------------------------------

参考:SVN 文档修订说明 阅读为什么它会为前一天的提交提供结果.

更新:
修订范围不适用于日期.

Update:
Revision range is not applied on date.

svn co -r {2012-09-04}:{2012-09-14} svn://location/of/my/repository/branch
svn: Revision range is not allowed

但是,如果您只想查看两个日期范围之间更改的文件.看看日志

However, if you just wanted to see the files altered between two date range. Just see the log

  svn log -r {2012-09-04}:{2012-09-14}