Mercurial - 确定是否需要从远程存储库进行合并
我们有两个存储库:myapp
和 myapp-1.1
。我们将 myapp-1.1 合并到 myapp 中。
要查看 1.1 中是否有需要合并的更改,我这样做:
cd c:\myapp (local clone)
hg fetch (fetch from remote myapp repo)
hg in ssh://hg/myapp-1.1 (see what needs to be merged in from remote 1.1 repo)
这可行 - 但有更好的方法吗?有没有办法在不需要本地 myapp 克隆的情况下执行此操作?
We have two repositories: myapp
and myapp-1.1
. We merge myapp-1.1 into myapp.
To see if there are changes in 1.1 that need to be merged I do this:
cd c:\myapp (local clone)
hg fetch (fetch from remote myapp repo)
hg in ssh://hg/myapp-1.1 (see what needs to be merged in from remote 1.1 repo)
This works - but is there a better way? Is there a way to do this without requiring the local myapp clone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Mercurial 不能对远程存储库做太多事情,除了某些推送或拉取远程存储库的变体。
因此,您想要要求 Mercurial 做的任何事情都必须通过本地克隆来完成。
所以不,没有办法让 Mercurial 检查两个远程存储库是否需要合并。
Mercurial can't do much with remote repositories except for some variant of pushing to, or pulling from them.
As such, anything you want to ask Mercurial to do has to be done with a local clone.
So no, there is no way to have Mercurial check if two remote repositories needs to be merged.
本地克隆到底有什么问题?
如果您想隔离存储库所在机器上的所有操作,您可以执行以下操作:
What's the problem with having local clone, exactly?
If you want to isolate all operations on machine the repo is located, you could do the following:
这似乎是显而易见的回应,但由于 Mercurial 是一个完全分布式的源代码控制系统,并且每个存储库都是独立的,因此您是否有可能真正转到包含 myapp 的盒子并直接从 myapp-1.1 获取?我知道大多数开发团队都保留某种集中式存储库,但这并不排除直接从您的“中央”存储库中使用 Mercurial。它仍然是本地和远程存储库。
这假设您想要完全合并 myapp 和 myapp1.1。否则,根据您正在执行的操作的定义,您必须将 myapp 克隆到另一个完整存储库,然后将其与 myapp-1.1 合并。
This may seem like the obvious response, but since Mercurial is a completely distributed source control system, and each repo is stand alone, is it possible for you to actually go to the box that has myapp and fetch directly from myapp-1.1? I know most dev teams keep some kind of centralized repository, but that doesn't preclude the use of Mercurial directly from the box that you have as your 'central' repository. It's all still local and remote repositories.
This assumes that you want to fully merge myapp and myapp1.1. Otherwise, pretty much by definition of what you're doing, you have to clone myapp to another full repository, then merge it with myapp-1.1.
假设远程存储库和本地存储库都不允许每个分支有多个头,则此命令应该告诉本地存储库是否在给定分支处具有远程存储库的头:
如果本地存储库没有该变更集,但在以下位置有传出变更集: “branch_name”,那么通常它应该是需要合并的指示符。
Assuming neither the remote repo nor the local repo allows multiple heads per branch, this command should tell if the local repo has the head of the remote repo at a given branch:
If local repo doesn't have that changeset, but has outgoing changesets at "branch_name", then typically it should be an indicator that merge is needed.