简体   繁体   中英

Can I get a Mercurial with Subversion subrepository to automatically check out?

I've set up a Mercurial repository that has a subversion subrepository. I've configured an .hgsub file so that Mercurial is aware of that repository. However, I was expecting that Mercurial could trigger an svn update automatically whenever I did a pull on the repository.

Is this possible with Mercurial subversion repositories? If not, what's the advantage of having the .hgsub file at all as opposed to placing that subdirectory in .hgignore ?

Mercurial does not automatically pull/update subrepos. From hg help subrepos :

Subrepos do not automatically track the latest changeset of their sources. Instead, they are updated to the changeset that corresponds with the changeset checked out in the top-level changeset. This is so developers always get a consistent set of compatible code and libraries when they update.

Thus, updating subrepos is a manual process. Simply check out target subrepo at the desired revision, test in the top-level repo, then commit in the parent repository to record the new combination.

Placing the repo in .hgignore would not allow you to track which version of the subrepo is compatible/tested with each version of the parent.

In SVN terms, this is similar to create an svn:external link which is bound to a specific SVN revision.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM