Upgrading older versions of Mercurial with sub-keys that have moved

There are several remote subrepos in our project, and their addresses have recently moved from http://host/path to http://other_host/path . How can I get back to revising, say, last month, when Mercurial thinks the subfield 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 
+6
source share
2 answers

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

It comes down to defining rules for reordering the locations of the source places in the form

 <pattern> = <replacement> 

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

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

rewrites

 http://server/foo-hg/ into http://hg.server/foo/. 
+6
source

You cannot do this. Mercurial returns to the state that it had exactly at this revision (URL subrepo, revision in subrepo)

-5
source

Source: https://habr.com/ru/post/908910/


All Articles