Mercurial:将变更集推送到仓库 A,不知何故仓库 B 也有它?
我在服务器上有一个名为“Gold”的存储库,作为我的生产存储库,在服务器上有一个名为“Silver”的存储库,充当开发存储库,然后显然在我的本地客户端上有一个或多个存储库。奇怪的是,当我将变更集从本地开发机器推送到 Gold 时,Silver 也会以某种方式获取变更集。我们在 IIS7.5 上的 Windows Server 2008R2 上运行 Mercurial。
示例:
服务器(在服务器上创建 Gold)
- mkdir Gold
- cd ./Gold
- hg init
客户端(将 Gold 克隆到客户端)
- hg clone http://server/Gold Dev
- cd Dev
- echo "Foo" > bar.txt
- hg ci -Am "added file bar.txt"
- hg push
此时客户端和服务器已同步,每个都有一个变更集。
服务器(克隆 Gold进入 Silver - 一个新的开发存储库 - 在服务器上)
- cd ..
- hg clone ./Gold Silver
Client (提交并推送更改为 Gold - 不触及 Silver)
- echo "Fizz" >嗡嗡声.txt
- hg ci -Am“添加文件嗡嗡声.txt”
- hg推送
现在我希望黄金有两个变更集,而白银有一个。在我们这里的环境中,Gold &白银不知何故都有两个变更集!我们推送到黄金的任何更改都会自动显示在白银中。这对我来说似乎非常出乎意料——以前有人遇到过这种情况吗?
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.
Example:
Server (create Gold on server)
- mkdir Gold
- cd ./Gold
- hg init
Client (clone Gold to client)
- hg clone http://server/Gold Dev
- cd Dev
- echo "Foo" > bar.txt
- hg ci -Am "added file bar.txt"
- hg push
At this point the client and server are in synch, each with one changeset.
Server (clone Gold into Silver - a new dev repo - on server)
- cd ..
- hg clone ./Gold Silver
Client (commit & push change to Gold - not touching Silver)
- echo "Fizz" > buzz.txt
- hg ci -Am "added file buzz.txt"
- hg push
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯。这当然不应该发生。有多种方法可以让它发生(使用钩子),但它不应该单独发生。
对于本地克隆(您的
hg clone ./Gold Silver
行),mercurial 在幕后使用硬链接来节省磁盘空间,但它会在写入时破坏这些链接。但是,作为测试,您可以将该行更改为:
这将使用更多磁盘空间,但其他方面相同。
我不希望这能解决任何问题,但我想这是一个很好的数据点。
Hrm. That certainly shouldn't happen. There are ways you could make it happen (using hooks), but it shouldn't happen on its own.
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:
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.