diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -727,15 +727,13 @@ def overrideclone(orig, ui, source, dest raise util.Abort(_( '--all-largefiles is incompatible with non-local destination %s' % d)) - result = hg.clone(ui, opts, source, dest, - pull=opts.get('pull'), - stream=opts.get('uncompressed'), - rev=opts.get('rev'), - update=opts.get('updaterev') or not opts.get('noupdate'), - branch=opts.get('branch')) - if result is None: - return True - if opts.get('all_largefiles'): + + return orig(ui, source, dest, **opts) + +def hgclone(orig, ui, opts, *args, **kwargs): + result = orig(ui, opts, *args, **kwargs) + + if result is not None and opts.get('all_largefiles'): sourcerepo, destrepo = result repo = destrepo.local() @@ -750,8 +748,11 @@ def overrideclone(orig, ui, source, dest # Caching is implicitly limited to 'rev' option, since the dest repo was # truncated at that point. success, missing = lfcommands.downloadlfiles(ui, repo, None) - return missing != 0 - return result is None + + if missing != 0: + return None + + return result def overriderebase(orig, ui, repo, **opts): repo._isrebasing = True diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py --- a/hgext/largefiles/uisetup.py +++ b/hgext/largefiles/uisetup.py @@ -77,8 +77,9 @@ def uisetup(ui): overrides.overrideclone) cloneopt = [('', 'all-largefiles', None, _('download all versions of all largefiles'))] + entry[1].extend(cloneopt) + entry = extensions.wrapfunction(hg, 'clone', overrides.hgclone) - entry[1].extend(cloneopt) entry = extensions.wrapcommand(commands.table, 'cat', overrides.overridecat) entry = extensions.wrapfunction(merge, '_checkunknownfile', diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -717,6 +717,12 @@ Test cloning with --all-largefiles flag 3 largefiles updated, 0 removed $ cd .. +Ensure base clone command argument validation + + $ hg clone -U -u 0 a a-clone-failure + abort: cannot specify both --noupdate and --updaterev + [255] + $ hg clone --all-largefiles a ssh://localhost/a abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a [255]