恢复 Subversion 存储库并使其恢复到每个人本地更改的最新状态
我没有使用 hotcopy 来备份我的 Subversion 存储库。我们使用 Visual SVN Server(最新)和 tortoise。我几天前复制了 C:\Repositories 并备份了它,现在我想恢复它。
我现在可以通过复制备份的存储库文件夹来使用存储库。
然后我想现在我已经手动检查了团队中每个人的本地项目,看看谁有最新的修订版?如果是这样,那将花费我几个小时。
有人知道这是正确的方法还是唯一的方法?真的是这个说明书吗?我想这是因为每个人都有不同的本地变化。
I did not use the hotcopy to back up my Subversion repository. We use Visual SVN Server (latest) with tortoise. I copied C:\Repositories and backed that up a few days ago and now I want to restore it.
I'm able to use the repository now with the backed up Repository folder copied over.
and then I guess now I have manually go through everyone's local project on the team to see who has the lates revision? If so that will take me hours.
anyone know if this is the right way or only way? Is it really this manual? I guess it would be because everyone has different changes locally.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个方法怎么样,各位开发者:
请注意,您可以遇到比平常更多的合并冲突,但可以用通常的方式解决。
How about this approach, each developer:
Note that you may get more merge conflicts than usual, but they can be resolved in the usual manner.
自备份以来所做的任何更改都不存在于存储库中,每个人都必须从恢复的存储库中重新签出。 (修订号已更改,如果不更改,您将陷入混乱。)
至于从开发人员的本地副本中挽救任何更改,是的,这将是相当手动的。然而,“diff”和“patch”是你的朋友。如果您不熟悉 cygwin,您将需要了解它并获取 diff、patch、diffutils 和 patchutils 软件包,以便您拥有“diff”命令和“patch”命令。您可以使用“diff”命令创建一个文件,其中包含源树的一个副本与另一个副本之间的增量。您需要像这样使用它:
对每个开发人员的工作副本执行此操作。
您可以使用这些文件并使用“patch”命令将更改应用到新的结帐中,如下所示:
您现在将拥有包含更改的工作副本。 (尽管没有 svn adds、svn rms 和属性更改。)从那里,确定需要提交的内容。
您可以使用“filterdiff”命令获取补丁文件并过滤掉部分更改,通过管道将其发送到补丁,它将仅应用这些更改。
编辑:
另一种选择:
对于每个开发人员,创建一个分支并签出该分支,然后将其本地副本复制到该新工作副本中的文件并提交。
这样所有的工作都可以保存在存储库中,而不会丢失。然后,在尝试将分支合并到主干时,您将不得不处理冲突。此时,您应该能够使用 GUI 工具来选择保留或放弃哪些更改。
但简短的答案是:由于您没有最近的存储库备份,因此您有很多工作要做……所以一旦你们能够再次工作,请设置更频繁的备份计划。
Any changes that were made since the backup are not present in the repository, and everyone will have to do a fresh checkout from the restored repository. (The revision numbers have changed, and you'll have a mess if you don't.)
As for salvaging any changes from developer's local copies, yes, that's going to be rather manual. However, "diff" and "patch" are your friends. If you aren't familiar with cygwin, you'll want to get that and get the diff, patch, diffutils, and patchutils packages so you have the 'diff' command and the 'patch' command. You can use the "diff" command to create a file containing the delta between one copy of the source tree and another. You'll want to use it like this:
Do that for each developer's working copy.
You can take those files and apply the changes to a fresh checkout using the "patch" command like this:
You will now have a working copy with their changes. (Though without their svn adds, svn rms, and property changes.) From there, determine what needs to be committed.
You can use the "filterdiff" command to take the patch file and filter portions of the changes out, pipe that to patch, and it will apply just those changes.
edit:
Another option:
for each developer, create a branch and checkout that branch, then copy their local copy over the files in that new working copy and commit.
That gets all the work in the repository where it won't get lost. You will then have to deal with conflicts when trying to merge the branches into trunk. At that point, you should be able to use the gui tools to select which changes to keep or toss.
But the short answer is: you've got a lot of work to do since you don't have a very recent backup of the repo... so once y'all are able to work again, setup a much more frequent backup schedule.