简体   繁体   中英

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

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 ... Added a file to repo B from client and commited & pushed it up to http://SERVER/HG/B ... , it only works if I -f (force) the push 添加的文件,以回购从客户B和COMMITED和推它到http:// SERVER / HG / B ... ,仅当我-f(强制)推入时才有效
  • 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 ...
    Added a file to repo B from client and commited & pushed it up to E:/HG/B ...

...Something in the apache configuration or in the integration between apache & mercurial is making the repo "unrelated".... Any ideas??? ... apache配置中的某些问题或apache与mercurial之间的集成使回购变得“无关”。 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM