3

I was wondering if I right click on a file in the SVN repo browser, does it get permanently deleted? can it be recovered?

4

6 回答 6

4

You'll find that you can only delete from the Repo Browser when you are viewing the HEAD revision. This is identical to deleting a file from your working copy and then checking in the delete. In both cases, you'll be able to restore from the previous revision.

于 2009-12-01T05:36:52.590 回答
4

This question/answer from the SVN FAQ might interest you :

How do I completely remove a file from the repository's history?

There are special cases where you might want to destroy all evidence of a file or commit. (Perhaps somebody accidentally committed a confidential document.) This isn't so easy, because Subversion is deliberately designed to never lose information. Revisions are immutable trees which build upon one another. Removing a revision from history would cause a domino effect, creating chaos in all subsequent revisions and possibly invalidating all working copies.

The project has plans, however, to someday implement an svnadmin obliterate command which would accomplish the task of permanently deleting information. (See issue 516.)

In the meantime, your only recourse is to svnadmin dump your repository, then pipe the dumpfile through svndumpfilter (excluding the bad path) into an svnadmin load command.

If it's that hard, there are little chances it can be done easily from Tortoise SVN...
(And it's not the goal of Source Control...)

于 2009-12-01T05:38:52.133 回答
2

Deleting a file via the repo-browser context menu basically creates a new global revision where just that file was deleted, so it appears in the log as such - you can always revert to that revision to get the file back, or you can just pull it directly from the repository into your working copy.

于 2009-12-01T05:36:34.040 回答
1

No... Deleting a file (even using the repo browser) only affects working copies. It would be a pretty lousy revision control system if you couldn't recover a file from the past. It is actually pretty difficult to modify files in a committed revision, even if you have root access to the server.

于 2009-12-01T05:34:22.157 回答
0

Doesn't right-click just bring up some sort of menu? And with SVN is that you can always revert anyways.

于 2009-12-01T05:33:10.990 回答
0

我不小心从 Repo Browser 中删除了一个顶级目录,唯一的取回方法如下:

  • 从以前的版本历史中导出顶级文件夹
  • 在存储库中创建一个新文件夹以替换已删除的文件夹。
  • 将导出的文件添加回新目录(与以前的名称相同)
  • 更新工作副本,它将删除然后重新添加相同的文件。

这很烦人,但至少工作和回购将重新同步。“从该版本恢复更改”不适用于撤消 repo 删除,它仅在工作目录中恢复,而不是“撤消”对存储库的删除。

于 2010-04-13T18:59:54.883 回答