[英]“Hg to Hg (Gateway) to SVN” compared to “Git to Git (Gateway) to SVN”
Question is similar to this (unanswered) and this one (same problem not involving Git). 问题类似于此 (未答复)和此问题(同样的问题不涉及Git)。
The goal is to make Hg
a front end for SVN for a period of time before transitioning fully to Hg. 我们的目标是使
Hg
为SVN前端一段时间完全过渡到汞之前。
The setup should probably look like the one depicted below (same as in the questions referenced above), however I'm not sure about the exact topology of intermediate Hg repositories. 设置可能看起来如下所示(与上面提到的问题相同),但是我不确定中间Hg存储库的确切拓扑。
Dev1 Hg --> Hg <--> SVN
Dev2 Hg -/
I know that the above setup works with git
and git-svn
as described in this comment : 我知道上面的设置适用于
git
和git-svn
,如本评论中所述 :
Dev1 Git --> Git (bare) <--> Git (bridge) <--> SVN
Dev2 Git -/
Setup:
建立:
Either
git svn init
, orgit svn clone
the SVN repo.无论是
git svn init
,还是git svn clone
SVN repo。 This then becomes the “Git/SVN Bridge.”然后它成为“Git / SVN Bridge”。
Fix up any of the branches, tags, etc… here.
修复任何分支,标签等...这里。 The
svn/*
refs are considered remotes, so if you want tracking branches, check these remotes out and create appropriate local branches.svn/*
refs被认为是遥控器,所以如果你想跟踪分支,请检查这些遥控器并创建适当的本地分支。 Also, check the tags out, and create actual tags.另外,检查标签,并创建实际标签。 You MUST create local branches for any SVN branches that you wish to synchronize between Git and SVN.
您必须为要在Git和SVN之间同步的任何SVN分支创建本地分支。
Now, create a new bare repository (
git init
) somewhere, and from the bridge, push all the branches to the bare repo (git push –tags
).现在,在某处创建一个新的裸存储库(
git init
),并从桥中将所有分支git push –tags
裸存储库(git push –tags
)。All Git users now clone this bare repository.
所有Git用户现在克隆这个裸存储库。 The bridge will only be maintained by one (or a few) people that understand how to synchronize Git and SVN.
该桥只由一个(或几个)了解如何同步Git和SVN的人维护。
To update SVN trunk with changes on master, and vice-versa, from the bridge:
要通过网桥更改主服务器上的SVN中继,反之亦然:
git svn fetch
(get new SVN changes)git svn fetch
(获取新的SVN更改)
git checkout master
git pull master
(get Git changes from bare repo)git pull master
(从裸仓库中获取Git更改)
git checkout svn/trunk
(checkout detached head)git checkout svn/trunk
(checkout detached head)
git merge –no-ff –log master
(merge changes from master).git merge –no-ff –log master
(从master更改合并)。–no-ff
insures an actual commit,–log
copies individual log messages from each commit on master (–log
is optional).–no-ff
确保实际提交,–log
从master上的每个提交复制单个日志消息(–log
是可选的)。 git commit –amend can then be run if you want to edit the commit message.如果要编辑提交消息,则可以运行git commit -amend。
git svn dcommit
(This pushes your merge commit to SVN. Note that the commit was on a detached head, and is no longer accessible).git svn dcommit
(这会将你的合并提交推送到SVN。请注意,提交是在一个独立的头上,并且不再可访问)。 All of your work on master (since the merge-base of master andsvn/trunk
) gets committed as a single change, and is now available to SVN users.您在master上的所有工作(因为master和
svn/trunk
的merge-base)都作为单个更改提交,现在可供SVN用户使用。
git checkout master
git merge svn/trunk
(Gets the new updates from SVN – with the altered commit message – and merges to master)git merge svn/trunk
(从SVN获取新的更新 - 使用更改的提交消息 - 并合并到master)
git push barerepo
(makes the SVN changes available to Git users)git push barerepo
(使git push barerepo
用户可以使用SVN更改)
What I don't know is if it's possible to somehow replicate the above on Hg. 我不知道的是,是否有可能以某种方式在Hg上复制上述内容。 As I see it (I'm an intermediate Git user and know basics of working with Hg), the obstacles in Hg are:
正如我所看到的(我是Git的中间用户并且了解使用Hg的基础知识),Hg的障碍是:
hgsubversion
(step n. 6 in the above list. What stops hgsubversion
from doing what svn dcommit
does?) hgsubversion
推送合并提交(上面列表中的步骤hgsubversion
。什么阻止hgsubversion
做svn dcommit
做什么?) Is it possible to make the Hg-SVN gateway work in the same fashion the Git-SVN gateway works? 是否有可能使Hg-SVN网关以与Git-SVN网关相同的方式工作? If no, why?
如果不是,为什么?
The short version is: nobody's yet convinced me what the reasonable expected behavior of pushing a merge to Subversion should be, and there are some slight modifications to hgsubversion advisable to make pushing result in merges rather than rebased revisions. 简短的版本是:没有人确信我推出合并到Subversion的合理预期行为是什么,并且对hgsubversion有一些轻微的修改,建议推动合并而不是重新修订。 None of it should be too hard, just takes someone motivated to do the implementation.
这些都不应该太难,只需要有人动机去实施。 If you're curious, this thread has a similar request where I responded with a fairly in-depth discussion of the basic approach that I've thought through with a couple of others.
如果你很好奇, 这个帖子有一个类似的请求,我回答了一个相当深入的讨论我和其他几个人一起思考的基本方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.