我在学校服务器上有一个颠覆存储库,来自我和朋友上学期工作的一个项目。我们希望对这个项目进行完善,使其更像是一个投资组合项目,但我不太确定该存储库是否会在学校服务器上保持完整(他们通常会在几个学期后将其擦除)。我无权转储存储库,尽管我已经发送了一封电子邮件以查看是否可以获得一个 - 这将是最好的解决方案。
我尝试了 svnsync 但学校服务器不支持重播命令(可能已关闭),所以这对我不起作用。
现在,从理论上讲,是否可以(手动或以编程方式)签出存储库的每个修订版并将其签入我们自己的服务器上的新存储库?我认为它会起作用 - 我们只有 3 个人,并且没有我们需要担心的工作副本冲突,只是想要存储库中所有历史记录的副本,以防我们需要返回并查看它。
话虽这么说,在我通过编写脚本来重新发明轮子之前 - 这样的东西是否已经存在?我必须弄清楚已经有一个工具可以做到这一点,或者有人已经编写了一个脚本来做到这一点。
I have a subversion repository located on our school servers from a project my friends and I worked on the past semester. We want to take the project and polish it and make it more of a portfolio item and I'm not quite sure that the repo will stay intact on the school servers (they usually wipe it after a few semesters). I don't have access to dump the repo, although I've sent an email to see if I can get one - which would be the best solution.
I tried svnsync but the school server doesn't support the replay command (probably turned off), so that won't work for me.
Now, theoretically, wouldn't it be possible to (manually or programmatically) checkout each revision of the repository and check it in to a new repository on our own server? I think it would work - there's only 3 of us, and there's no working copy conflicts that we'd have to worry about, just want a copy of all the history in the repo in case we need to go back and look at it.
That being said, before I go and reinvent a wheel by writing a script to do it - does something like this already exist? I have to figure there's already a tool to do it, or that someone has wrote a script to do it.
发布评论
评论(4)
如果您愿意使用 Mercurial – 它 a) 在命令方面与 Subversion 相差并不远,b) 可以防止此类问题,c) 使用起来实际上很有趣* – 您可以使用 < a href="http://mercurial.selenic.com/wiki/ConvertExtension" rel="nofollow noreferrer">转换扩展。它内置于 Mercurial 中,您只需激活它即可。
* 无论如何我也这么认为
If you'd be willing to use Mercurial – which a) isn't terribly far away from Subversion, command-wise, b) would prevent this kind problem, and c) is actually fun to work with* – you can use the convert extension. It comes built into Mercurial, you just have to activate it.
* I think so, anyway
您没有指定项目中大约有多少个修订版。并且可以对每个修订进行基于脚本的检查。但这是不现实的,因为为每个文件夹创建了所有“.svn”文件夹。由于它们,您
您可以看到它不可行。我不知道有一个脚本可以做到这一点。
但是,您可以从存储库中进行多次导出,其中每一项都是最重要的提交,然后将它们添加到新存储库中。如果修改次数较少,那么应该会更容易。
You didnt specify how many revisions you have approximately in your project. And a script based check out for each revision is possible. But it is not realistic, because of all the ".svn" folders created for each folder. Because of them, you
As you can see its not feasible. And I do not know of a script to do this.
You can however do a number of exports from the repo, each one of the most important commits, and then add them to your new repository. If there are less number of revisions then it should be easier.
对 Subversion 存储库的读取访问应该始终足以在 svnsync。一个简短的示例如何执行此操作:
使用类似的内容创建钩子脚本
new_repos/hooks/pre-revprop-change
不要忘记使其可执行
然后初始化同步:
测试您的新存储库
并且不要忘记删除挂钩脚本
有关存储库复制的更多详细信息,请参阅 svn 书。
Read access to a subversion repository should always be enough create a clone of that repository with the help of svnsync. A short example how to do this:
Create hook script
new_repos/hooks/pre-revprop-change
with something likeDo not forget to make it executable
Then initialize an synchronize:
Test your new repository
And do not forget to remove the hook script
More details about repository replication can be found in the svn book.
我猜想
svnsync
由于一些小问题而无法工作; svnsync 和svnrdump
都不需要任何服务器端修改才能工作!如果您至少具有通过 HTTP(S) 对 Subversion 存储库的只读访问权限或
svn(+ssh)://
那么您绝对可以使用svnsync
或svnrdump
工具获取完整的修订历史记录。svnrdump
方法。只需运行命令并等待其完成:
svnrdump URL-TO-ORIGINAL-REPO > repo.dump
在结果中,您将获得包含完整更改历史记录的 repo.dump 文件。您可以稍后使用 svnadmin load 命令将该文件加载到空存储库。
svnsync
方法。所有步骤都应在您的(本地)计算机上执行:
创建新存储库:
svnadmin create newrepo
,允许更改新存储库的修订(未版本化)属性:
回显退出0> myrepo\hooks\pre-revprop-change.bat
svnsync init file:///C:\Repositories\newrepo https://URL-TO-ORIGINAL-REPO
< /p>svnsync 同步文件:///C:\Repositories\newrepo https://URL-TO-ORIGINAL-REPO
I guess that
svnsync
didn't work then because of some minor issue; neithersvnsync
norsvnrdump
require any server-side modifications to work!If you have at least Read Only access to Subversion repository via HTTP(S) or
svn(+ssh)://
then you definitely can get the complete revision history usingsvnsync
orsvnrdump
tools.svnrdump
approach.Just run the command and wait till it completes:
svnrdump URL-TO-ORIGINAL-REPO > repo.dump
In the result you will get repo.dump file that contains the complete history of changes. You can load the file to empty repository later using
svnadmin load
command.svnsync
approach.All steps should be performed on your (local) machine:
Create new repository:
svnadmin create newrepo
,Allow to change revision (unversioned) properties of the new repository:
echo exit 0 > myrepo\hooks\pre-revprop-change.bat
svnsync init file:///C:\Repositories\newrepo https://URL-TO-ORIGINAL-REPO
svnsync sync file:///C:\Repositories\newrepo https://URL-TO-ORIGINAL-REPO