Using a specific (git) branch in a mercury sub-repository

I have a mercurial project in which I would like to use jQuery-File-Upload. I added the following to my .hgsub file to create a sub-report for this plugin:

 public/assets/common/js/filedrop = [git]git://github.com/blueimp/jQuery-File-Upload.git 

The problem is what I need to use in the jquery-ui branch of this git repository in my project.

Is it possible to specify the git repository branch name for output as hg subrepo?

+5
source share
1 answer

Found it myself.

In fact, you do not need to do anything. All you have to do after editing your .hgsub to add your subrepo and clone it is to change the directory to this repository, check the required branch or rev and commit using mercury.

In my case, the whole process was (in the terminal):

 $ echo "public/assets/common/js/jQuery-File-Upload = [git]git://github.com/blueimp/jQuery-File-Upload.git" >> .hgsub $ cd public/assets/common/js/ $ git clone git://github.com/blueimp/jQuery-File-Upload.git $ cd jQuery-File-Upload $ git checkout jquery-ui $ hg commit -m"ADDED: jQuery-File-Upload subrepo (jquery branch)" 
+3
source

All Articles