ExternalProject: Tell "hg clone" not to implicitly update

By default Mercurial command "clone" will implicitly call "update" with
the "default" branch after downloading the cloned repository.  However
ExternalProject_Add() always generates a second "update" command after
cloning with a tag which is either specified or "tip" (equivalent to
"default" by default).  Therefore ExternalProject will first clone then
update to default branch then update to another specified branch if
provided.  This leads to potentially very long clone operation (in
particular when the repository default branch contain subrepos) which
can lead to transaction abort triggered by the server.

Simply use "hg clone -U" to avoid the implicit update during clone.
Our following call to "hg update" will take care of updating anyway.
This commit is contained in:
A. Joël Lamotte 2015-08-11 01:01:25 +02:00 committed by Brad King
parent 422d3f68de
commit 6a77a77a62
1 changed files with 1 additions and 1 deletions

View File

@ -609,7 +609,7 @@ if(error_code)
endif()
execute_process(
COMMAND \"${hg_EXECUTABLE}\" clone \"${hg_repository}\" \"${src_name}\"
COMMAND \"${hg_EXECUTABLE}\" clone -U \"${hg_repository}\" \"${src_name}\"
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)