使用 Bazaar 镜像 Subversion 存储库而不导入完整历史记录?

发布于 2024-12-04 11:17:03 字数 912 浏览 0 评论 0原文

我想使用 Bazaar 来处理一个使用 Subversion 且历史悠久的项目。例如svn://svn.freebsd.org/base/head

有一个很好的插件 bzr-svn 可以用来处理 SVN 存储库。 这里有一些相关工作流程的示例

我的问题是,我发现的所有内容似乎都是在假设我想从 SVN 导入完整历史记录的情况下编写的。我不想那样做。它占用了太多的磁盘空间(实际上,如果我尝试导入,则会耗尽内存)。我真的不关心某个 SVN revno/tag 之前的任何更改。但我确实想让每个人在截止点之后做出承诺,以便正确地出现在集市一侧。我怎样才能做到这一点?

我基本上希望我的供应商分支具有以下逻辑(我可以从中创建本地分支):

svn co svn://svn.freebsd.org/base/head -r CUTOFF_REVNO

while true
do
    svn up -r NEXT   # note: NEXT is not possible even though there is PREV
    bzr commit
    sleep N
done

显然,上面的内容没有在 Bazaar 中存储提交消息和其他此类内容,这是一个问题。我可以将其作为每日 cron 作业,只需执行 svn up 并在一天内将所有 SVN 更改提交到 Bazaar 分支,并在一次每日提交中完成。

我如何才能完成此任务,以便将元数据和单独提交正确转换为 Bazaar(与 SVN 端发生的粒度相同)?我不需要能够推送到 SVN。我所需要的只是一种单向解决方案。我希望有一个工具可以做到这一点!

I would like to use Bazaar for working with a project that uses Subversion and has a very long history. For example svn://svn.freebsd.org/base/head.

There is a good plugin bzr-svn which can be used to work with SVN repositories. There are some examples of relevant workflows here.

My issue is that everything that I have found seems to be written with an assumption that I want to import the full history from SVN. I do not want to do that. It takes too much disk space (and in reality the import will run out of memory if I try). I really do not care about any changes before a certain SVN revno/tag. But I do want to have each individual commit after the cutoff point to show up properly on the Bazaar side. How can I accomplish that?

I basically want the following logic for my vendor branch (from which I can make my local branches):

svn co svn://svn.freebsd.org/base/head -r CUTOFF_REVNO

while true
do
    svn up -r NEXT   # note: NEXT is not possible even though there is PREV
    bzr commit
    sleep N
done

Obviously the above does not store the commit messages and other such things in Bazaar, which is a problem. I could make this a daily cron job which just does svn up and commits all the SVN changes within a day into the Bazaar branch in one single daily commit.

How can I accomplish this so that the meta-data and individual commits are properly converted to Bazaar (with the same granularity as they happen on the SVN side)? I do not need to be able to push into the SVN. All I need is a one-way solution. I hope there is a tool somewhere which can do exactly this!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

话少心凉 2024-12-11 11:17:03

我想我找到了一个潜在的解决方案,所以我正在回答自己。

有一个名为 Tailor 的工具可以做到这一点。它是一个通用的解决方案,因此它适用于最流行的版本控制系统(例如 CVS、SVN、Bazaar、Mercurial、Git、Darcs 等)。

为了完成我的要求,我需要以下配置文件,例如 freebsd-tailor.conf

[DEFAULT]
verbose = True
projects = freebsd-current

[freebsd-current]
root-directory = /home/tailor/freebsd-current
subdir = upstream
source = svn:freebsd-current
target = bzr:freebsd-current
start-revision = 225424

[svn:freebsd-current]
repository = svn://svn.freebsd.org/base
module = /head
encoding = iso-8859-1

[bzr:freebsd-current]

然后我只需运行 tailor -c freebsd-tailor.conf 来执行初始操作在 revno 225424 进行同步,并在每次我想增量获取此后的新更改时重新运行该命令。

我目前正在测试这个。无论成功还是失败,我都会更新我的答案。仍然欢迎其他解决方案。 :)

更新:

我使配置示例变得更简单,并添加了许多项目似乎需要的 encoding 条目。

到目前为止,我的测试结果是 tailor 不幸的是对于大型项目(例如我的示例)来说不是很稳健。由于某种原因,我的 bzr 存储库中缺少一个子目录,并且使用裁缝提取更新非常慢并且需要大量资源。也许它适用于小型项目。我喜欢裁缝对不同的 VCS 有如此多的后端,并且对它们的差异保持中立。

I think I found a potential solution, so I am answering myself.

There is a tool called Tailor which can do exactly this. It is a generic solution, thus it works with most popular version control systems (such as CVS, SVN, Bazaar, Mercurial, Git, Darcs and some others).

To accomplish what I asked I need the following configuration file, for example freebsd-tailor.conf:

[DEFAULT]
verbose = True
projects = freebsd-current

[freebsd-current]
root-directory = /home/tailor/freebsd-current
subdir = upstream
source = svn:freebsd-current
target = bzr:freebsd-current
start-revision = 225424

[svn:freebsd-current]
repository = svn://svn.freebsd.org/base
module = /head
encoding = iso-8859-1

[bzr:freebsd-current]

Then I just run tailor -c freebsd-tailor.conf to do the initial synchronization at revno 225424 and re-run the command every time I want to incrementally fetch the new changes after that.

I am currently testing this. I will update my answer with any success or failure. Other solutions are still welcome. :)

UPDATE:

I made the configuration example a bit simpler and added encoding entry which seems to be required with many projects.

The result of my testing so far is that tailor is unfortunately not very robust with large projects (such as in my example). One subdirectory is missing for some reason in my bzr repository and pulling the updates with tailor is very slow and takes a lot of resources. Maybe it works fine with small projects. I like how tailor has so many back-ends to different VCSes and is neutral about their differences.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文