diff --git a/swh/loader/mercurial/hgutil.py b/swh/loader/mercurial/hgutil.py --- a/swh/loader/mercurial/hgutil.py +++ b/swh/loader/mercurial/hgutil.py @@ -1,11 +1,11 @@ import io -import traceback from multiprocessing import Process, Queue +import traceback from typing import Dict, NewType # The internal Mercurial API is not guaranteed to be stable. +from mercurial import context, hg, util # type: ignore import mercurial.ui # type: ignore -from mercurial import context, hg, util NULLID = mercurial.node.nullid HgNodeId = NewType("HgNodeId", bytes) @@ -46,7 +46,13 @@ errors: message queue to communicate errors """ try: - hg.clone(mercurial.ui.ui.load(), {}, src.encode(), dest.encode()) + hg.clone( + ui=mercurial.ui.ui.load(), + peeropts={}, + source=src.encode(), + dest=dest.encode(), + update=False, + ) except Exception as e: exc_buffer = io.StringIO() traceback.print_exc(file=exc_buffer) diff --git a/swh/loader/mercurial/loader.py b/swh/loader/mercurial/loader.py --- a/swh/loader/mercurial/loader.py +++ b/swh/loader/mercurial/loader.py @@ -195,7 +195,7 @@ def do_clone(queue, origin, destination): try: - result = hglib.clone(source=origin, dest=destination) + result = hglib.clone(source=origin, dest=destination, noupdate=True) except CommandError as e: # the queued object need an empty constructor to be deserialized later queue.put(CommandErrorWrapper(e.err))