Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
包含绝对路径的Mercurial[子路径]附加到主回购';推送时的默认路径_Mercurial_Mercurial Subrepos - Fatal编程技术网

包含绝对路径的Mercurial[子路径]附加到主回购';推送时的默认路径

包含绝对路径的Mercurial[子路径]附加到主回购';推送时的默认路径,mercurial,mercurial-subrepos,Mercurial,Mercurial Subrepos,在Windows上运行Mercurial 2.0.2: 在我的.hgrc中: [subpaths] MYREPOS/(.*) = https://server/repos/\1 在我的.hgsub中: subrepo/lib = MYREPOS/lib 当我推送时,子回购的推送路径是其路径到主回购的串联,而不是绝对路径-输出为: pushing to https://server/repos/main pushing subrepo subrepo\lib to https://serve

在Windows上运行Mercurial 2.0.2:

在我的.hgrc中:

[subpaths]
MYREPOS/(.*) = https://server/repos/\1
在我的.hgsub中:

subrepo/lib = MYREPOS/lib
当我推送时,子回购的推送路径是其路径到主回购的串联,而不是绝对路径-输出为:

pushing to https://server/repos/main 
pushing subrepo subrepo\lib to https://server/repos/main/http%3A//server/repos/lib
我原以为:

pushing to https://server/repos/main
pushing subrepo subrepo\lib to https://server/repos/lib

是否因为次级回购路径的“绝对性或相对性”是由.hgsub中的右侧路径决定的,而不是其映射的值?例如,MYREPOS/lib是相对的,因此映射的路径将被视为相对的,无论它是否是相对的?

子存储库逻辑已更改。现在的程序是:

  • 如果
    .hgsub
    中的路径是相对路径,则将其与主存储库路径连接
  • 将重新映射规则应用于此最终路径
  • 在此更改之前,我们将:

  • 将重新映射规则应用于
    .hgsub
  • 如果重新映射的路径是相对的,则将其与主存储库路径连接
  • 因此,在第一步中,
    MYREPOS/lib
    被视为一条相对路径,这是正确的。因此,子存储库的完整路径为

    https://server/repos/main/MYREPOS/lib
    
    你的重新映射模式仍然会触发。这解释了为什么您会看到
    http://...在推送URL的中间。但是,有一个回退,将恢复到旧的行为。如果你的模式是

    ^MYREPOS/(.*) = https://server/repos/\1
    
    然后它将不匹配新步骤2中的任何内容-它将只在路径的开头重新映射
    MYREPOS
    。我们注意到这一点,并使用旧的算法