使用已移动的子存储库更新到旧的 Mercurial 修订版

发布于 2025-01-07 08:45:44 字数 923 浏览 0 评论 0原文

我们的项目中有几个远程子存储库,它们的地址最近从 http://host/path 移动到 http://other_host/path。如何返回到上个月的修订版本,Mercurial 认为可以在 http://host/path 找到子存储库?

$ hg -v up -d 1/20/2012
Found revision 1091 from Fri Jan 20 10:22:29 2012 -0600
resolving manifests
abort: error: No connection could be made because the target machine actively refused it


$ hg --debug up -d 1/20/2012
Found revision 1091 from Fri Jan 20 10:22:29 2012 -0600
resolving manifests

<snip...>

subrepo merge 0f0f2b807811+ 0908d5249a6f 0f0f2b807811
  subrepo external/our_remote_repo: both sides changed, merge with https://old_host/external/our_remote_repo:c66cf52ce1f240193190cec392d889618c09f22b:hg
using https://old_host/external/our_remote_repo
sending capabilities command
using auth.old_host.* for authentication
abort: error: No connection could be made because the target machine actively refused it

Our project has a couple of remote subrepos in it, and their addresses have recently moved from http://host/path to http://other_host/path. How can one go back to a revision from, say, last month, where Mercurial thinks the subrepo can be found at http://host/path?

$ hg -v up -d 1/20/2012
Found revision 1091 from Fri Jan 20 10:22:29 2012 -0600
resolving manifests
abort: error: No connection could be made because the target machine actively refused it


$ hg --debug up -d 1/20/2012
Found revision 1091 from Fri Jan 20 10:22:29 2012 -0600
resolving manifests

<snip...>

subrepo merge 0f0f2b807811+ 0908d5249a6f 0f0f2b807811
  subrepo external/our_remote_repo: both sides changed, merge with https://old_host/external/our_remote_repo:c66cf52ce1f240193190cec392d889618c09f22b:hg
using https://old_host/external/our_remote_repo
sending capabilities command
using auth.old_host.* for authentication
abort: error: No connection could be made because the target machine actively refused it

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

梦途 2025-01-14 08:45:44

根据 文档,您可以使用 hgrc 中的 [subpaths] 重新映射此类网址

这归结为定义子存储库源位置重写规则的形式,

<pattern> = <replacement>

其中模式是与源匹配的正则表达式,替换是用于重写它的替换字符串。组可以在模式中匹配并在替换中引用。例如:

http://server/(.*)-hg/ = http://hg.server/\1/

重写

http://server/foo-hg/ into http://hg.server/foo/.

According to documentation you can use [subpaths] in hgrc to remap such urls.

This boils down to defining subrepositories source locations rewriting rules in the form of

<pattern> = <replacement>

where pattern is a regular expression matching the source and replacement is the replacement string used to rewrite it. Groups can be matched in pattern and referenced in replacements. For instance:

http://server/(.*)-hg/ = http://hg.server/\1/

rewrites

http://server/foo-hg/ into http://hg.server/foo/.
梦回梦里 2025-01-14 08:45:44

你做不到。 Mercurial 返回本次修订版的状态(子存储库的 URL,子存储库中的修订版)

You can't do it. Mercurial returns in the state, which it had exactly at this revision (URL of subrepo, revision in subrepo)

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