Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a specific (git) branch in a mercurial subrepository

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

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

The problem I have is that I need to use in the jquery-ui branch of this git repo in my project.

Is there any way to specify the branch name of a git repo to pull as a hg subrepo?

like image 854
nstCactus Avatar asked Oct 21 '22 17:10

nstCactus


1 Answers

Found it out by myself.

In fact you don't need to do anything special. All you have to do, after editing your .hgsub to add your subrepo, and cloning it, is to change directory to that repository, checkout the desired branch or rev and commit using mercurial.

In my case, the whole process was (in a 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)"
like image 66
nstCactus Avatar answered Nov 15 '22 03:11

nstCactus