SVN加载新的存储库
我目前正在将一个存储库从 Linux 迁移到 Windows。我遇到的问题是,加载新存储库时,层次结构为 [reponame]\[reponame]
。有没有办法将所有文件夹上移一级?
UPDATE
使用以下命令来获取存储库加载 svnadmin 加载 [repo] > [存储库文件].dump
I am currently migrating a repo from Linux to windows. The problem I am having is that when load the new repository the hierarchy is [reponame]\[reponame]
. Is there a way to move all the folders up one level?
UPDATE
used the following command to get the repo load
svnadmin load [repo] > [repofile].dump
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Unix 下的存储库层次结构是怎样的?你在那里使用http吗?
我不是 100% 确定你的意思。您是说存储库包含一个包含存储库名称的目录吗?或者,您是说当您进行结帐时,您现在会执行以下操作:
结帐命令现在是什么样子?
当您说存储库时,您是在谈论使用
svnadmin create
命令创建的单个存储库目录,还是在谈论单个存储库中的多个项目?假设我正在使用 svnserve 来为我的存储库提供服务。我们将我的存储库命名为
myproj
,我想在我的机器softserve
上提供我的存储库。当我想要结账时,我会这样做:注意,我只有服务器的名称。该 URL 甚至不包含我的存储库的名称。这是因为 svnserve 只能为单个存储库提供服务。如果我有多个存储库,我要么必须拥有单独的计算机,要么将所有存储库合并到一个存储库中,要么使用不同的端口。
Apache 可以为多个存储库提供服务,但每个存储库都需要一个虚拟 Web 目录才能访问,因此 Apache 看到 URL 时就知道它是 Subversion 存储库,而不是 httpdocs 目录之外的目录。因此,Apache URL 中至少多了一个目录。
有两种不同的方法可以指定 Apache Subversion 存储库。您可以像这样指定单个存储库:
在这种情况下,每个 Apache 虚拟目录都有一个存储库。因此,当我进行结帐时,我的命令如下所示:
请注意,此 URL 中的 svn URL 上有一个额外的目录。那是因为我现在不仅需要指定服务器,还需要指定 Apache 虚拟目录。在本例中,我使虚拟目录名称与存储库名称一致。我没有理由需要这样做,但否则就很愚蠢了。
对于用户而言,他们只是将存储库名称添加到 URL 中。这仍然有道理。如果我想从
myproj
签出,我使用http://softserve/myproj
,如果我想从project_two
签出,我使用 <代码>http://softserve/project_two。然而,有时一家公司可能拥有数百个 Subversion 存储库,并通过其 Subversion 服务器提供服务。指定 Apache 配置中的每个存储库非常困难,尤其是当它们不断添加新项目并消除旧项目时。
要解决此问题,您可以使用
SVNParentPath
规范而不是SVNPath
。这允许您指定不是 Subversion 存储库目录,而是指定它应驻留的父目录:现在,我可以将所有存储库放在我的服务器上的单个目录下,Apache 将自动为它们提供所有服务。创建新存储库后,我只需将其放在我的
SVNParentPath
下。我不必修改我的 Apache 配置。问题是现在我不仅必须指定 Apache 虚拟目录,还必须指定存储库名称。因此,我的 URL 中包含另一个目录。 (在本例中,我将 Apache Parent 虚拟目录称为
source
)。我刚刚下载了VisualSVN Server并查看了它。 VisualSVN Server 在后端运行 Apache。它只是自动为您配置它并创建一个漂亮的简单前端。查看
C:\Program Files\VisualSVN Source\conf\httpd.conf
下创建的 Apache 配置,我看到了这一点:我可以想象当您设置 VisualSVN 时,它会自动执行后者。毕竟,这就是人们愿意为 VisualSVN 付费的原因——它会为您处理所有 Apache 存储库处理工作。而且,就您而言,您所做的操作导致了如下结果:
并且,
C:/path/to/repository
下的唯一存储库是您的foo
存储库。因此,您的 URL 如下所示:因此,如果您将
foo
存储库放在C:\Repositories
下,您的结帐如下所示:我没有玩弄 VisualSVN服务器看看我是否可以从前端更改 svn Apache 虚拟目录名称,但我可以想象您购买了允许更多配置的完整版本,并且您将目录命名为相同的名称你的存储库名称。因此,您有
,并且当您从
foo
签出时,您会得到:您提到的双存储库名称。
我可以想象您可以破解原始
http.conf
文件以使用SVNPath
而不是SVNParentPath
,因此您的 URL 将如下所示:但是,我不知道 Visual SVN 将如何处理这个问题。我怀疑您最好的选择是将 Apache 虚拟目录名称更改回默认的 svn 或将其更改为 source 或 src。
What was the repository hierarchy under Unix? Were you using http there?
I'm not 100% sure what you you mean. Are you saying that the repository contains a directory that contains the name of the repository? Or, are you saying that when you do a checkout, you now do something like this:
What does a checkout command now look like?
When you say repository are you talking about a single repository directory you created with the
svnadmin create
command, or are you talking about multiple projects in a single repository?Let's say I'm using
svnserve
to serve my repository. We'll call my repositorymyproj
and I want to serve my repository on my machinesoftserve
. When I want to do a checkout, I do this:Notice I only have the name of my server. The URL doesn't even include the name of my repository . That's because
svnserve
can only serve a single repository. If I have multiple repositories, I'll either have to have separate machines, merge all the repositories into a single repository, or use different ports.Apache can service multiple repositories, but each repository needs a virtual web directory for access, so Apache know when it sees the URL it's a Subversion repository and not a directory out of the httpdocs directory. Thus, there's at least one more directory in the Apache URL.
There are two separate ways of specifying an Apache Subversion repository. You can specify a single repository like this:
In this case, each Apache virtual directory has a single repository. Thus, when I do a checkout, my command looks like this:
Notice that there's an extra directory in this URL over the svn URL. That's because I now not only have to specify the server, but also the Apache virtual directory. In this case, I made my virtual directory names agree with my repository name. There's no reason I need to do that, but it would be silly otherwise.
As far as the user is concerned, they're just adding the repository name into the URL. It still makes sense. If I want to checkout from
myproj
, I usehttp://softserve/myproj
and if I want to checkout fromproject_two
, I usehttp://softserve/project_two
.However, sometimes a company may have hundreds of Subversion repositories they're serving off their Subversion server. Specifying each and every repository in the Apache configuration is tough, especially if they keep adding in new projects and eliminating old ones.
To get around this issue, you can use the
SVNParentPath
specification instead ofSVNPath
. This allows you to specify not the Subversion repository directory, but the parent directory where it should reside:Now, I can put all of my repositories under a single directory on my server, and Apache will automatically serve them all. When a new repository is created, I only have to put it under my
SVNParentPath
. I don't have to modify my Apache configuration.The problem is now I have to specify not only the Apache virtual directory, but also the repository name. Thus, my URL has another directory in it. (In this case, I called my Apache Parent virtual directory
source
).I just downloaded VisualSVN Server and looked at it. VisualSVN Server runs Apache in the back end. It just automatically configures it for you and creates a nice simple front end. Looking at the created Apache configuration under
C:\Program Files\VisualSVN Source\conf\httpd.conf
, I see this:I can imagine when you setup VisualSVN, it does the latter automatically. After all, that's why people will pay for VisualSVN -- it takes care of all the Apache repository handling for you. And, in your case, you did something that resulted in something like this:
And, the only repository under
C:/path/to/repository
is yourfoo
repository. Thus, your URL looks like this:So, if you put your
foo
repository underC:\Repositories
, your checkout looks like this:I didn't play around with VisualSVN Server to see if I can change the
svn
Apache virtual directory name from the front end, but I can imagine that you bought the full version that allows for more configuration, and you named your directory the same name as your repository name. Thus, you haveAnd, when you check out from
foo
, you get this:The double repository name you mentioned.
I can imagine you can hack the raw
http.conf
file to useSVNPath
instead ofSVNParentPath
, and thus your URL would be something like this:But, I don't know how Visual SVN would handle that. I suspect your best bet would be to just change your Apache virtual directory name back to the default
svn
or change it tosource
orsrc
.