如何将变更集从hg存储库导出到svn存储库 [英] How do I export changesets from hg repository to svn repository

查看:98
本文介绍了如何将变更集从hg存储库导出到svn存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道mercurial有hgsubversion扩展。但在我知道它是如何工作之前,我维护了两个独立的存储库,一个是SVN回购,另一个是Hg回购。我在Hg仓库中最近做了大部分改动,我需要将它们推到svn仓库。



最简单的方法是获取从svn的一个版本与hg的一个版本同步。

从那里开始,我更新到下一个版本(来自Hg),然后将其提交到(svn) 。对许多变更集重复这些步骤是相当不方便的。有没有更方便的方法来做到这一点?



如果可能的话,这个解决方案可以在Windows操作系统中使用。



问候,



Afriza

解决方案

线性系列变更集(无合并),您可以为循环使用shell 循环

 <$ c $在$(seq $(hg id -n -r。)$(hg id -n -r tip));做
hg update $ therev
svn commit -m$(hg log --template'{desc}'-r。)
done

从检出版本循环到提示并提交每个都保留提交消息。您可能需要做一些特殊的事情来添加/删除文件。


I know there is hgsubversion extension for mercurial. But before I knew how it works, I maintain two separate repositories, one is SVN repo and one is Hg repo. I made most of my recent changes in the Hg repository and I need to "push" them to the svn repository.

The most straight forward way to do this is to get one revision from svn which is in sync with one revision from hg.

From there, I update to the next revision (from Hg), then commit it (to svn). Repeating these steps for many changesets is rather inconvenient. Are there more convenient ways to do this?

And if possible, solution that works in Windows OS.

Regards,

Afriza

解决方案

If you're talking about a linear series of changesets (no merges) you could employ a shell for loop

for therev in $(seq $(hg id -n -r .) $(hg id -n -r tip)) ; do
  hg update $therev
  svn commit -m "$(hg log --template '{desc}' -r .)"
done

That loops from the checkedout revision to the tip and commits each in turn preserving the commit message. You probably need to do something fancy arround added/removes files.

这篇关于如何将变更集从hg存储库导出到svn存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆