是否可以使用 Mercurial 从 SourceGear Vault 存储库中拉取/推送到该存储库?
我注意到这种功能是为了颠覆而存在的,而且效果非常好。我想知道 SourceGear Vault 是否有这样的东西。
I noticed that this kind of functionality exists for subversion and it works very nicely. I was wondering if there is such thing for SourceGear Vault.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,恐怕我们只有用于 Subversion 和 Git。我还没有听说有人为 SourceGear Vault 编写桥梁。
但是,您仍然可以在其他系统之上使用 Mercurial。这是适用于所有版本控制系统 (VCS) 的通用技术。您要做的如下:
从国外版本控制系统中检查最新版本的代码。初始化 Mercurial 存储库,添加所有文件并进行提交:
工作副本现在既是 Mercurial 工作副本,又是外部系统的工作副本。您将在 Mercurial 中进行开发并定期将其导入到外部系统中,并且您将定期将更改从外部 VCS 导入到 Mercurial 中。
我们将使用名为
default
的分支来跟踪外部系统的历史记录,并使用名为hg
的命名分支来跟踪我们在 Mercurial 中所做的开发。注意: Anton 在下面评论说,如果您使用命名分支来分隔两条开发线,Vault 将显示太多文件 - 如果这对您来说是一个问题,请使用两个克隆。
让我们创建
hg
分支:您现在可以开发一些东西:
当您像这样工作时,
default
分支将开始与hg
分叉>分支——区别正是尚未导出到外部系统的更改。 差异您可以看到与要实际导出更改,您更新到
default
分支,将hg
合并到其中并将更改提交到外部系统的:然后您可以更新返回到
hg
分支并继续使用 Mercurial当其他人在外部 VCS 中进行更改时,您必须将它们合并回您的
hg
分支。您首先更新到default
分支。这可以确保工作副本看起来像外部 VCS 期望的那样。然后,您可以更新工作副本——这使 Mercurial 看到您提交给 Mercurial 的更改:hg addremove
步骤确保 Mercurial 拾取外部 VCS 中发生的任何重命名。您需要尝试相似性参数以找到适合您的设置。使用hg status -C
查看计划的重命名。您现在需要将这些更改合并回
hg
分支,以便您可以将它们合并到您进一步的基于 Mercurial 的工作中:您继续像这样工作 - 始终在
上进行新的本地开发hg
分支,并在使用外部 VCS 命令(更新、提交等)之前始终更新到default
分支。我希望本指南可以帮助您或其他人! :-)
Nope, I'm afraid we only have two-way bridges for Subversion and Git. I have not heard of anyone writing a bridge for SourceGear Vault.
However, you can still use Mercurial on top of the other system. This is a general technique that works for all version control systems (VCSs). What you do is the following:
Checkout the latest version of the code from your foreign version control system. Initialize a Mercurial repository, add all files, and make a commit:
The working copy is now both a Mercurial working copy as well as a working copy for the foreign system. You will be doing development in Mercurial and periodically import it into the foreign system, and you will periodically import changes from the foreign VCS into Mercurial.
We will use the branch called
default
to track the history of the foreign system, and a named branch calledhg
to track the development we do in Mercurial.Note: Anton comments below that Vault will show too many files if you use named branches to separate the two lines of development — use two clones instead if this is a problem for you.
Let us make the
hg
branch:You can now develop something:
As you work along like this, the
default
branch will begin to diverge from thehg
branch -- the difference is exactly the changes that have yet to be exported to the foreign system. You can see the differences withTo actually export the changes, you update to the
default
branch, mergehg
into it and commit the change to your foreign system:You can then update back to the
hg
branch and continue working with MercurialWhen changes are made by others in the foreign VCS, you have to merge them back into your
hg
branch. You first update to thedefault
branch. This ensures that the working copy looks how the foreign VCS expects it to look like. You can then update the working copy -- this makes Mercurial see changes, which you commit to Mercurial:The
hg addremove
step makes sure that Mercurial picks up any renames that has taken place in the foreign VCS. You will need to experiment with the similarity parameter to find a setting that suits you. Usehg status -C
to see the scheduled renames.You now need to merge these changes back into the
hg
branch so that you can incorporate them in your further Mercurial-based work:You continue working like this -- always making new local development on the
hg
branch, and always updating to thedefault
branch before you use the foreign VCS commands (update, commit, etc).I hope this guide can help you or someone else! :-)