从在线SVN存储库中仅手动删除最新修订版? [英] Manually deleting only the latest revision from online SVN repository?

查看:99
本文介绍了从在线SVN存储库中仅手动删除最新修订版?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在执行以下操作: git svn dcommit提交错误的文件?,现在我在SVN服务器端存储库上有一个-最新的-版本错误;我想删除它.我知道我可以按照

In doing this: git svn dcommit committing wrong file?, now I have one - the latest - revision on the SVN server-side repository wrong; I'd like to delete it. I am aware I could do svnadmin dump/filter/load as per How do I fix a repository with one broken revision?, but I hoped there was an easier solution.

所以我尝试了这个测试:

So I tried this test:

cd /tmp
svnadmin create newRepo
svn co file:///tmp/newRepo newRepo-checkout
# Checked out revision 0.
cd newRepo-checkout/

echo aaa > AA.txt
svn add AA.txt 
# A         AA.txt
svn ci -m 'first commit'
# Adding         AA.txt
# Transmitting file data .
# Committed revision 1.

echo bbb > BB.txt
svn ci -m '2ns commit'
svn add BB.txt 
# A         BB.txt
svn ci -m '2nd commit'
# Adding         BB.txt
# Transmitting file data .
# Committed revision 2.

echo ccc > CC.txt
svn add CC.txt 
# A         CC.txt
svn ci -m '3rd commit'
# Adding         CC.txt
# Transmitting file data .
# Committed revision 3.

现在,如果我只是将db/revs和db/revprops中的相应文件删除到最新修订版(3),我会得到:

Now, if I just delete the corresponding files to the latest revision (3) in db/revs and db/revprops, I get this:

$ cd ../newRepo
$ svnadmin verify .
* Verified revision 0.
* Verified revision 1.
* Verified revision 2.
* Verified revision 3.
$ ls db/revprops/0/
0  1  2  3
$ ls db/revs/0/
0  1  2  3  

$ rm db/revs/0/3 
$ rm db/revprops/0/3 

$ svnadmin verify .
* Verified revision 0.
* Verified revision 1.
* Verified revision 2.
svnadmin: No such revision 3

经过一番摸索后,发现文件./db/txn-current./db/current的内容为"3",所以我尝试更改它:

After some grepping it turns out there are files ./db/txn-current and ./db/current with content '3', so I try to change that:

$ echo 2 > ./db/current
$ echo 2 > ./db/txn-current

$ svnadmin verify .
* Verified revision 0.
* Verified revision 1.
* Verified revision 2.

...以及svn co file:///tmp/newRepo newRepo-checkout2似乎也可以工作.

... and also svn co file:///tmp/newRepo newRepo-checkout2 seems to work as well.

所以我的问题是-这在安全性上是否合理,或者关于在SVN服务器中存储修订的内容,还有其他内容吗?

So my question is - is this reasonably safe, or is there more to it regarding the storage of a revision in SVN server?

推荐答案

否.手动编辑存储库数据库文件永远不会合理地安全".只需使用svn工具进行转储/过滤/加载,它会更安全,并且最终可能会更容易.

No. Manually editing the repository database files is never "reasonably safe". It is much safer, and probably in the end much easier, just to do the dump/filter/load using svn tools.

这篇关于从在线SVN存储库中仅手动删除最新修订版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆