Is it possible to bind the Mercurial subrepot to a specific revision (for example, svn: externals)?

I am moving a set of projects from Subversion to Mercurial. Currently, projects use svn: externals to extract code from one to the other. I followed the recommendation of pointing external data to a specific revision number and manually updating it as needed (so when I update the previous revision of the main project, I also get the previous version of the external).

The way to do external in Mercurial seems to be related to subrepos, but I don’t see a way to link them to a specific revision - it seems that Hg will always update subrepos to the latest version whenever I update the main repo transaction. It's right? And is there a way around this?

+4
source share
3 answers

(copied from my comment above)

Turns out I was wrong. It does not upgrade to the latest version, it updates the version specified in the .hgsubstate file, which is version controlled and is automatically updated with every commit. Thus, it is actually simpler than external SVNs, since the revision does not need to be manually reordered; each revision of the main repo is automatically associated with the corresponding revisions of the subpost.

+1
source

In your .hgsub file .hgsub you can use the syntax http://[user[:pass]@]host[:port]/[path][#revision] (or local/filesystem/path[#revision] ) (see hg help urls for additional examples) to bind a subreport to a specific revision. For this patch line, you can even use #branchname or #tagname to track the tip of a particular branch (ex stable ) or a roaming tag (ex: release ) so that you only get a new version when a branch or tag on a remote backwater is updated.

+3
source

It seems that suburpos Mercurial is always updated to the last end of the remote repository.

I suggest that if you use a specific version of a remote repository and update this version only infrequently, it is better to roll this revision into your main repository. This means that you are no longer dependent on an external source for verification.

0
source

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


All Articles