Mercurial hg - 通过 APACHE 推送到克隆存储库时出现“存储库不相关”错误

发布于 2024-09-05 16:37:54 字数 866 浏览 4 评论 0原文

两种情况,一种有效,一种无效,而两者都应该:

  • 场景#1:(不能通过 apache 工作)
    • 服务器 SERVER 上有 2 个存储库:存储库“A”、存储库“B”通过 http://SERVER/HG/A 从存储库 A 克隆
    • 在客户端:
      从 http://SERVER/HG/A 克隆的存储库 A
      从 http://SERVER/HG/B 克隆的存储库 B
    从客户端将文件添加到存储库 A 并提交&将其推至 http://SERVER/HG/A ...WORKS 从客户端将文件添加到存储库 B 并提交&将其推送到 http://SERVER/HG/B ...中止错误:存储库不相关,只有当我 -f(强制)推送时它才有效
  • 场景#2:(通过文件系统工作)
    • 在服务器 SERVER 上:从 E:/HG/A 克隆的存储库“A”、存储库“B”
    • 在客户端:
      从 E:/HG/A 克隆的回购协议 A
      从 E:/HG/B 克隆的 Repo B
    从客户端将文件添加到存储库 A 并提交&将其推至 E:/HG/A ...WORKS
    从客户端将文件添加到存储库 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫瑾少女 2024-09-12 16:37:54

我不太清楚你的情况出了什么问题,但我打电话告诉,当 Mercurial 说“不相关”时,这意味着:这两个存储库没有一个或多个根。

通常,mercurial 存储库有一个根目录,修订版 0,任何具有相同根目录的存储库都可以推送到它。存储库可以有多个根,通常是某人执行 push -f 的结果。

因此,您在场景一中所做的事情应该完全有效。如果不是,那么您的 apache 配置指向 http://SERVER/HG/B 的位置与您认为的不同(可能是错误的 RewriteRuleRedirectMatchScriptAlias,或者您的存储库 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 bad RewriteRule or RedirectMatch or ScriptAlias, 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文