Added support for checking out tags from git

This commit is contained in:
Benjamin Nortier 2010-09-15 11:10:53 +01:00
parent 83cece0f80
commit ed8ecf751f

View file

@ -269,10 +269,16 @@ download_source(AppDir, {hg, Url, Rev}) ->
ok = filelib:ensure_dir(AppDir), ok = filelib:ensure_dir(AppDir),
rebar_utils:sh(?FMT("hg clone -U ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)), rebar_utils:sh(?FMT("hg clone -U ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)),
rebar_utils:sh(?FMT("hg update ~s", [Rev]), [], AppDir); rebar_utils:sh(?FMT("hg update ~s", [Rev]), [], AppDir);
download_source(AppDir, {git, Url, Rev}) -> download_source(AppDir, {git, Url, {branch, Branch}}) ->
ok = filelib:ensure_dir(AppDir), ok = filelib:ensure_dir(AppDir),
rebar_utils:sh(?FMT("git clone -n ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)), rebar_utils:sh(?FMT("git clone -n ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)),
rebar_utils:sh(?FMT("git checkout ~s", [Rev]), [], AppDir); rebar_utils:sh(?FMT("git checkout ~s", [Branch]), [], AppDir);
download_source(AppDir, {git, Url, {tag, Tag}}) ->
ok = filelib:ensure_dir(AppDir),
rebar_utils:sh(?FMT("git clone -n ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)),
rebar_utils:sh(?FMT("git checkout -b ~s", [Tag]), [], AppDir);
download_source(AppDir, {git, Url, Rev}) ->
download_source(AppDir, {git, Url, {branch, Rev}});
download_source(AppDir, {bzr, Url, Rev}) -> download_source(AppDir, {bzr, Url, Rev}) ->
ok = filelib:ensure_dir(AppDir), ok = filelib:ensure_dir(AppDir),
rebar_utils:sh(?FMT("bzr branch -r ~s ~s ~s", rebar_utils:sh(?FMT("bzr branch -r ~s ~s ~s",