Mercurial hg - 通过 APACHE 推送到克隆存储库时出现“存储库不相关”错误
两种情况,一种有效,一种无效,而两者都应该:
- 场景#1:(不能通过 apache 工作)
- 服务器 SERVER 上有 2 个存储库:存储库“A”、存储库“B”通过 http://SERVER/HG/A 从存储库 A 克隆
- 在客户端:
从 http://SERVER/HG/A 克隆的存储库 A
从 http://SERVER/HG/B 克隆的存储库 B
- 场景#2:(通过文件系统工作)
- 在服务器 SERVER 上:从 E:/HG/A 克隆的存储库“A”、存储库“B”
- 在客户端:
从 E:/HG/A 克隆的回购协议 A
从 E:/HG/B 克隆的 Repo B
从客户端将文件添加到存储库 B 并提交&将其推至 E:/HG/B ...工作
结论:...apache 配置或 apache 与 之间的集成中的某些内容。 Mercurial 正在使回购“无关”...... 有什么想法吗???为什么我需要在第一种情况下强制,但在第二种情况下不需要? ...我通过 tortoisehg 以及命令行尝试了这两种情况。
Two scenarios, one work one doesn't when they both should:
- Scenario #1: (DOES NOT work via apache)
- 2 repos on Server SERVER: Repo "A", Repo "B" cloned from repo A via http://SERVER/HG/A
- On client:
Repo A cloned from http://SERVER/HG/A
Repo B cloned from http://SERVER/HG/B
Added a file to repo A from client and commited & pushed it up to http://SERVER/HG/A ...WORKS
Added a file to repo B from client and commited & pushed it up to http://SERVER/HG/B ...ERROR with abort: repository is unrelated, it only works if I -f (force) the push
- Scenario #2: (works via file system)
- On Server SERVER: Repo "A", Repo "B" cloned from E:/HG/A
- On client:
Repo A cloned from E:/HG/A
Repo B cloned from E:/HG/B
Added a file to repo A from client and commited & pushed it up to E:/HG/A ...WORKS
Added a file to repo B from client and commited & pushed it up to E:/HG/B ...WORKS
Conclusion:...Something in the apache configuration or in the integration between apache & mercurial is making the repo "unrelated"....
Any ideas??? Why do I need to force in the first scenario but do not have to in the second??
...and i tried both scenarios via tortoisehg as well as command line.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不太清楚你的情况出了什么问题,但我打电话告诉,当 Mercurial 说“不相关”时,这意味着:这两个存储库没有一个或多个根。
通常,mercurial 存储库有一个根目录,修订版 0,任何具有相同根目录的存储库都可以推送到它。存储库可以有多个根,通常是某人执行
push -f
的结果。因此,您在场景一中所做的事情应该完全有效。如果不是,那么您的 apache 配置指向
http://SERVER/HG/B
的位置与您认为的不同(可能是错误的RewriteRule
或RedirectMatch
或ScriptAlias
,或者您的存储库 B 没有像您想象的那样从存储库 A 克隆,或者存储库 A 或 B 在 B 最初克隆后发生了根本性变化。如果用于修改根(修订版 0)节点的哈希码:mq、histedit、strip、rebase 等,将会改变该节点的哈希码。这是因为更改哈希会完全改变存储库,这些工具默认禁用并用于仅本地、未推送的更改
要开始调试,请进入服务器并查看如果您在文件系统级别的存储库 A 和 B 之间进行传入或传出,会发生什么情况,那么您就知道它不是 apache,并且如果是这样,那么这就是您的 Apache 设置的问题。
I don't know quite what's going wrong in your case, but I call tell that when mercurial says 'unrelated' it means: the two repositories do not have a root or roots.
Normally a mercurial repository has a single root, revision 0, and any repository with that same root can push to it. A repository can have multiple roots, usually the result of someone doing a
push -f
.So what you're doing in Scenario one, should exactly work. If it's not then either your apache configuration is pointing
http://SERVER/HG/B
somewhere other than you think it should be (perhaps a badRewriteRule
orRedirectMatch
orScriptAlias
, or your Repo B didn't clone from Repo A like you thought it did, or Repo A or B changed fundamentally after B was initially cloned.There are some tools that will alter the hashcode of your root (revision 0) node if used to modify that node: mq, histedit, strip, rebase, etc. And it's because changing the hash completely alters the repo that those tools are disabled by default and for use on local, un-pushed changes only.
To start debugging this, go onto the SERVER and see what happens if you do do incoming or outgoing between repos A and B at the file system level. If those complain then you know it's not apache, and if they do, then it's something your Apache setup.