how to use svndumpfilter to exclude a certain revision

守給你的承諾、 提交于 2019-12-05 04:43:28

问题


I have an SVN repository with a bad revision or two. I need to get rid of them! I was planning on using the svndumpfilter tool, which has an exclude command. However, I cannot figure out how to use it to exclude a revision. Everytime I use it, I end up with a Malformed dumpfile header error. See the command below; I want to exclude revision 23, and code is the directory containing the repository.

>svndumpfilter exclude 23 code
Excluding prefixes:
   '/23'
   '/code'

SVN-fs-dump-format-version: 2

<waits for me to type something and press enter>

'vndumpfilter: E140001: Malformed dumpfile header '

回答1:


svndumpfilter tool uses the stdin as input and filters only on certain paths, so you cannot exclude a specific revision. However you can try to dump your repository from rev 0 to rev. 22 and continue from rev 24 to HEAD, however, this will work only if no file changed in rev 23 is changed after rev 23 again.

Here a small script:

svnadmin dump my -r0:22 code > /path/to/dumpfile_1.dmp
svnadmin dump --incremental -r24:HEAD code > /path/to/dumpfile_2.dmp

If you want to create a new repository out of dumpfiles:

svnadmin create code_correct
svnadmin load code_correct <  /path/to/dumpfile_1.dmp 
svnadmin load code_correct <  /path/to/dumpfile_2.dmp


来源:https://stackoverflow.com/questions/11679926/how-to-use-svndumpfilter-to-exclude-a-certain-revision

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!