How to deal with Git repo submodules that convert to Mercurial

Here:

$ cat .gitmodules [submodule "utils/external/firepython"] path = utils/external/firepython url = git://github.com/darwin/firepython.git [submodule "utils/external/textile"] path = utils/external/textile url = git://github.com/jsamsa/python-textile.git 

While this was a Git repo, I needed to run git submodule init , after which some magic would happen. Since I now converted the repo to Mercurial (using the hgext.git extension), I don't know what to do. Is there an equivalent process (I need these 2 Git modules in my Mercurial repo)?

+9
git dvcs git-submodules mercurial mercurial-subrepos
Apr 10 2018-11-11T00:
source share
1 answer

Mercurial supports various types of subrepositories : Mercurial, Subversion, and Git. So you can create a .hgsub file with

 utils/external/firepython = [git]git://github.com/darwin/firepython.git utils/external/textile = [git]git://github.com/jsamsa/python-textile.git 

and this will tell Mercurial to clone your Git repositories when cloning Mercurial. You need to first make Git clones or copy them from another location to disk:

 $ git clone git://github.com/darwin/firepython.git utils/external/firepython $ git clone git://github.com/jsamsa/python-textile.git utils/external/textile $ hg add .hgsub $ hg commit -m 'Added Git subrepositories' 

You will then notice that Mercurial has added the .hgsubstate file to your repository, where it stores information about the Git sub-repositories. This file is required for Mercurial to know which revision will exit your subitems when creating a new Mercurial clone.

My colleague wrote a subrepository guide that may be useful to you.

+12
Apr 10 2018-11-11T00:
source share



All Articles