Version 5 (modified by jazz, 13 years ago) (diff) |
---|
2012-03-09
svndumpfilter
- 由於 trac 的 svn 裡有 hadoop4win-setup 目錄,而 sourceforge 的 svn 紀錄是新的,所以想試試看能否合併。
- [參考] SourceForge 的 SVN 匯入文件有提到 Filtering the dump file (optional)
- [參考] SVNBOOK 也有提到 Filtering Repository History
- 採用 SVNBOOK 的步驟,首先把 hadoop4win 的部份獨立成一個 Repository
jazz@Wdebian:~/trac_pool/trac_pool/grid$ svnadmin dump svnroot/ > grid_svn_dumpfile ....... * Dumped revision 248. jazz@Wdebian:~/trac_pool/trac_pool/grid$ svndumpfilter include --drop-empty-revs --renumber-revs hadoop4win-setup < grid_svn_dumpfile > hadoop4win_dumpfile jazz@Wdebian:~/trac_pool/trac_pool/grid$ svnadmin create hadoop4win jazz@Wdebian:~/trac_pool/trac_pool/grid$ svnadmin load --ignore-uuid hadoop4win < hadoop4win_dumpfile ........ ------- Committed revision 30 >>> jazz@Wdebian:~/trac_pool/trac_pool/grid$ rm grid_svn_dumpfile hadoop4win_dumpfile jazz@Wdebian:~/trac_pool/trac_pool/grid$ mv hadoop4win ~/hadoop4win_trac
- 做到這一步,我們可以拿到一個只有 hadoop4win-setup 這個目錄的 svnroot。(這裡我多用了 --drop-empty-revs 跟 --renumber-revs 兩個參數,如此可以讓原本 248 個 changeset 的 grid repository 過濾成只有 30 個 changeset 的 hadoop4win repository.
- 根據 sourceforge 的說明,可以用 rsync 方式取回
jazz@Wdebian:~$ mkdir -p hadoop4win_sf jazz@Wdebian:~$ cd hadoop4win_sf/ jazz@Wdebian:~/hadoop4win_sf$ rsync -av hadoop4win.svn.sf.net::svn/hadoop4win/* . jazz@Wdebian:~/hadoop4win_sf$ cd jazz@Wdebian:~$ svnadmin dump hadoop4win_sf/ > hadoop4win_sf_dumpfile .......... * Dumped revision 15. jazz@Wdebian:~$ svnadmin load --ignore-uuid hadoop4win_trac/ < hadoop4win_sf_dumpfile .......... ------- Committed new rev 45 (loaded from original rev 15) >>>
- 做到這一步,算是完整地將整個專案 SVN 合併成一個。好在時間點兩個是相互錯開的,不然還真不知道怎麼根據時間點順序做合併呢!
- 接著把這個 SVN repository 用 svnadmin dump 指令先產生一個 hadoop4win_dumpfile 的檔案。然後 scp 到 shell.sf.net
jazz@Wdebian:~$ svnadmin dump hadoop4win_trac/ > hadoop4win_dumpfile .... * Dumped revision 45. jazz@Wdebian:~$ scp hadoop4win_dumpfile jazzwang,hadoop4win@shell.sf.net:.
- 登入 shell.sf.net
jazz@Wdebian:~$ ssh -t jazzwang,hadoop4win@shell.sf.net create [jazzwang@shell-24009 ~]$ adminrepo --checkout svn [jazzwang@shell-24009 ~]$ rm -rf /svnroot/hadoop4win/* [jazzwang@shell-24009 ~]$ svnadmin create /svnroot/hadoop4win [jazzwang@shell-24009 ~]$ svnadmin load --ignore-uuid /svnroot/hadoop4win/ < hadoop4win_dumpfile [jazzwang@shell-24009 ~]$ adminrepo --save svn **** Ignoring the contents of the hooks directory (hooks are managed via the web) **** Save and unlock the svn repository for hadoop4win? [ny] y
- 這樣就算是完整把整個開發過程移植到 sourceforge 去啦!!!!大功告成!!!