开发者

mercurial hg - pushing to a cloned repository via APACHE errors with "repository is unrelated"

开发者 https://www.devze.com 2023-01-03 13:18 出处:网络
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

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/H开发者_开发问答G/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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号