Using a specific (git) branch in a mercurial subrepository
Asked Answered
R

1

6

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?

Ret answered 14/2, 2013 at 8:34 Comment(0)
R
4

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)"
Ret answered 14/2, 2013 at 9:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.