1. 程式人生 > >svn如何根據提交日誌信息回退版本

svn如何根據提交日誌信息回退版本

let info add ref 回退版本 for 記錄 search 包含

問題場景:

1 記得提交的日誌信息中包含openssl,但是不記得這次提交的版本號revesion,是svn初始化後中間的某次提交;

2 svn環境的操作系統平臺為Fedora, 即命令行下;而且svn log的提交記錄有12659條;

[root@localhost v2.1]# svn log | grep r | wc -l
12659

解決辦法:

step1 查找提交日誌信息對應的版本號 r33178

[root@localhost v2.1]# svn log --search openssl
------------------------------------------------------------------------
r33183 | somebody | 2019-01-24 15:59:21 +0800 (Thu, 24 Jan 2019) | 1 line

delete fc28 openssl
------------------------------------------------------------------------
r33178 | somebody | 2019-01-24 12:48:31 +0800 (Thu, 24 Jan 2019) | 1 line

add openssl refers packages
------------------------------------------------------------------------

step2: 確定現在最新的版本號 r33205

[root@localhost v2.1]# svn log -l 2
------------------------------------------------------------------------
r33205 | somebody | 2019-02-19 17:20:27 +0800 (Tue, 19 Feb 2019) | 1 line

Tue Feb 19 17:20:27 CST 2019
------------------------------------------------------------------------
r33204 | somebody | 2019-02-19 17:20:26 +0800 (Tue, 19 Feb 2019) | 1 line

Tue Feb 19 17:20:26 CST 2019
------------------------------------------------------------------------

step3: 合並改版本內容到目版本中

svn merge -r 33205:33178 ""
   ........
   C openssl-devel-1.1.0h-3.fc28.i686.rpm
   C openssl-libs-1.1.0h-3.fc28.i686.rpm
   C openssl-pkcs11-0.4.7-6.fc28.i686.rpm
   C openssl-static-1.1.0h-3.fc28.i686.rpm
--- Recording mergeinfo for reverse merge of r33205 through r33179 into ‘.‘:  

step4: 提交合並內容到版本中

svn commit -m "recover revison-33178 to latest revision "

svn如何根據提交日誌信息回退版本