【问题标题】:Updating to old Mercurial revisions with subrepos that have moved使用已移动的子存储库更新到旧的 Mercurial 修订
【发布时间】:2012-02-20 17:02:40
【问题描述】:

我们的项目中有几个远程子存储库,它们的地址最近从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

【问题讨论】:

    标签: mercurial subrepos mercurial-subrepos


    【解决方案1】:

    根据documentation,您可以在hgrc 中使用[子路径] 到remap such urls

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

    <pattern> = <replacement>
    

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

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

    重写

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

    【讨论】:

      【解决方案2】:

      你做不到。 Mercurial 返回的状态与此修订版完全相同(子存储库的 URL,子存储库中的修订版)

      【讨论】:

        猜你喜欢
        • 2021-04-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-12-03
        相关资源
        最近更新 更多