diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-03-03 15:37:42 +0000 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-03-03 15:40:27 +0000 |
commit | 3ef3a7abece87ff8b2cc9957a1242e91141a6380 (patch) | |
tree | 445466bb1a566d86e9afc094a4b11cb7cdbecd0e | |
parent | 27dae6a65570811a0e15d12559cc9220784995a4 (diff) |
Fix hg diffing
- fetch more complete refs for tags (may download more history than
required, but it works)
- Fix comparison of tag distance by using lists everywhere
-rw-r--r-- | src/rebar_hg_resource.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rebar_hg_resource.erl b/src/rebar_hg_resource.erl index 1bd992e..a67abb9 100644 --- a/src/rebar_hg_resource.erl +++ b/src/rebar_hg_resource.erl @@ -61,7 +61,7 @@ download(Dir, {hg, Url, {branch, Branch}}, _State) -> [{cd, filename:dirname(Dir)}]); download(Dir, {hg, Url, {tag, Tag}}, _State) -> ok = filelib:ensure_dir(Dir), - rebar_utils:sh(?FMT("hg clone -q -r ~s ~s ~s", + rebar_utils:sh(?FMT("hg clone -q -u ~s ~s ~s", [Tag, Url, filename:basename(Dir)]), [{cd, filename:dirname(Dir)}]); download(Dir, {hg, Url, {ref, Ref}}, _State) -> @@ -115,7 +115,7 @@ get_tag_distance(Dir, Ref) -> [{use_stdout, false}, {debug_abort_on_error, AbortMsg}]), Log = string:strip(LogString, both, $\n), - [Tag, Distance] = re:split(Log, "-([0-9]+)$", [{parts,0}]), + [Tag, Distance] = re:split(Log, "-([0-9]+)$", [{parts,0}, {return, list}]), {Tag, Distance}. get_branch_ref(Dir, Branch) -> |