本文介绍了Mercurial:将变更集推送到存储库A,但存储库B也以某种方式将它推送到存储库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在名为"Gold"的服务器上有一个存储库,它作为我的生产存储库存在,在服务器上有一个名为"Silver"的存储库充当开发存储库,然后在我的本地客户端上显然有一个或多个存储库.奇怪的是,当我将变更集从本地开发机器推送到Gold时,Silver也以某种方式获得了变更集.我们正在IIS7.5的Windows Server 2008R2上运行Mercurial.

I have a repo on the server named "Gold" that exists as my production repo, a repo named "Silver" on the server that acts as a dev repo, and then obviously one or more repos on my local client. Strangely enough, when I push a changeset from my local dev machine to Gold, Silver also somehow gets the changeset. We are running Mercurial on Windows Server 2008R2 on IIS7.5.

示例:

服务器(在服务器上创建金牌)

Server (create Gold on server)

  • mkdir Gold
  • cd ./金
  • hg初始化

客户(将金牌克隆给客户)

Client (clone Gold to client)

  • hg clone http://server/Gold 开发
  • cd开发
  • 回显"Foo"> bar.txt
  • hg ci -Am添加了文件bar.txt"
  • 汞推
  • hg clone http://server/Gold Dev
  • cd Dev
  • echo "Foo" > bar.txt
  • hg ci -Am "added file bar.txt"
  • hg push

此时,客户端和服务器处于同步状态,每个都有一个变更集.

服务器(将金牌克隆为白银-服务器上的新开发仓库)

Server (clone Gold into Silver - a new dev repo - on server)

  • cd ..
  • 汞克隆./金银

客户(将更改提交并推送为金-不涉及银)

Client (commit & push change to Gold - not touching Silver)

  • 回显嘶嘶声"> buzz.txt
  • hg ci -Am添加了文件buzz.txt"
  • 汞推

现在,我希望黄金具有两个变更集,而银将具有一个变更集.在我们的环境中,黄金和银都以某种方式拥有两个变更集!我们推送至金牌的任何更改都会自动以银牌显示.对我来说这似乎是出乎意料的意外-之前有人遇到过这种情况吗?

Now I would expect Gold to have two changesets and Silver to have one. In our environment here, Gold & Silver both somehow have both changesets! Any change we push to Gold automatically shows up in Silver. This seems incredibly unexpected to me - has anyone run into this before?

推荐答案

Hrm.那当然不应该发生.有多种方法可以实现它(使用钩子),但它不应该自己发生.

Hrm. That certainly shouldn't happen. There are ways you could make it happen (using hooks), but it shouldn't happen on its own.

对于本地克隆(您的hg clone ./Gold Silver行),mercurial在幕后使用硬链接来节省磁盘空间,但在写入时会断开这些链接.

In the case of a local clone (your hg clone ./Gold Silver line) mercurial uses hardlinks under the covers to save on disk space, but it breaks those links on write.

但是,作为测试,您可以将该行更改为:

As a test, however, you could change that line to:

hg clone --pull ./Gold Silver

将使用更多的磁盘空间,但在其他方面相同.

which will use more diskspace, but be otherwise identical.

我不希望它能解决任何问题,但是我认为这是一个很好的数据点.

I don't expect that to fix anything, but I guess it's a good datapoint to have.

这篇关于Mercurial:将变更集推送到存储库A,但存储库B也以某种方式将它推送到存储库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 17:23