我需要自动执行某项任务
我需要找到指定URL的指定版本之前的svn版本
如何使用svn
工具以及如何在svnkit
中执行此操作?
例如,我有以下历史记录:
D:\wc\trunk>svn log svn://localhost/pg/trunk -q
------------------------------------------------------------------------
r99 | user | 2016-01-27 16:29:11 +0200 (Wed, 27 Jan 2016)
------------------------------------------------------------------------
r98 | user | 2016-01-27 16:28:59 +0200 (Wed, 27 Jan 2016)
------------------------------------------------------------------------
r90 | user | 2016-01-27 16:28:48 +0200 (Wed, 27 Jan 2016)
------------------------------------------------------------------------
r86 | user | 2016-01-27 16:28:35 +0200 (Wed, 27 Jan 2016)
------------------------------------------------------------------------
r85 | user | 2016-01-27 16:28:24 +0200 (Wed, 27 Jan 2016)
------------------------------------------------------------------------
r62 | user | 2016-01-26 18:04:47 +0200 (Tue, 26 Jan 2016)
详细输出:
D:\wc\trunk>svn log svn://localhost/pg/trunk -v
------------------------------------------------------------------------
r99 | user | 2016-01-27 16:29:11 +0200 (Wed, 27 Jan 2016) | 1 line
Changed paths:
M /trunk/f1.txt
Change 4
------------------------------------------------------------------------
r98 | user | 2016-01-27 16:28:59 +0200 (Wed, 27 Jan 2016) | 1 line
Changed paths:
M /trunk/f1.txt
Change 3
------------------------------------------------------------------------
r90 | user | 2016-01-27 16:28:48 +0200 (Wed, 27 Jan 2016) | 1 line
Changed paths:
M /trunk/f1.txt
Change 2
------------------------------------------------------------------------
r86 | user | 2016-01-27 16:28:35 +0200 (Wed, 27 Jan 2016) | 1 line
Changed paths:
M /trunk/f1.txt
Change 1
------------------------------------------------------------------------
r85 | user | 2016-01-27 16:28:24 +0200 (Wed, 27 Jan 2016) | 1 line
Changed paths:
A /trunk/f1.txt
Init revision
------------------------------------------------------------------------
r62 | user | 2016-01-26 18:04:47 +0200 (Tue, 26 Jan 2016) | 1 line
Changed paths:
A /trunk
1
------------------------------------------------------------------------
我需要知道修订版90之前的修订版 如何获得之前的修订版?
答案 0 :(得分:2)
交换给-r
开关的修订顺序将反转搜索顺序。从SVN存储库,这将显示给定范围内的两个最早的修订版(1700000到HEAD):
> svn log --limit=2 -r1700000:HEAD -q http://svn.apache.org/repos/asf/subversion/trunk/
------------------------------------------------------------------------
r1700035 | kotkov | 2015-08-29 10:16:13 -0400 (Sat, 29 Aug 2015)
------------------------------------------------------------------------
r1700130 | rhuijben | 2015-08-30 12:02:56 -0400 (Sun, 30 Aug 2015)
------------------------------------------------------------------------
这将显示最新的两个:
> svn log --limit=2 -rHEAD:1700000 -q http://svn.apache.org/repos/asf/subversion/trunk/
------------------------------------------------------------------------
r1727040 | philip | 2016-01-27 08:23:08 -0500 (Wed, 27 Jan 2016)
------------------------------------------------------------------------
r1727028 | stefan2 | 2016-01-27 08:02:24 -0500 (Wed, 27 Jan 2016)
------------------------------------------------------------------------
我自己不是SVNKit用户,但我想它也支持这一点。