diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py index 3a1c6b64e052c66a589557aeb377eea5cd034a1f_aGdleHQvbGFyZ2VmaWxlcy9vdmVycmlkZXMucHk=..6e2ab601be3f4b9f5b05d62e640a35d2366154c6_aGdleHQvbGFyZ2VmaWxlcy9vdmVycmlkZXMucHk= 100644 --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -727,15 +727,13 @@ 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 @@ # 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 index 3a1c6b64e052c66a589557aeb377eea5cd034a1f_aGdleHQvbGFyZ2VmaWxlcy91aXNldHVwLnB5..6e2ab601be3f4b9f5b05d62e640a35d2366154c6_aGdleHQvbGFyZ2VmaWxlcy91aXNldHVwLnB5 100644 --- a/hgext/largefiles/uisetup.py +++ b/hgext/largefiles/uisetup.py @@ -77,4 +77,6 @@ overrides.overrideclone) cloneopt = [('', 'all-largefiles', None, _('download all versions of all largefiles'))] + entry[1].extend(cloneopt) + entry = extensions.wrapfunction(hg, 'clone', overrides.hgclone) @@ -80,5 +82,4 @@ - 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 index 3a1c6b64e052c66a589557aeb377eea5cd034a1f_dGVzdHMvdGVzdC1sYXJnZWZpbGVzLnQ=..6e2ab601be3f4b9f5b05d62e640a35d2366154c6_dGVzdHMvdGVzdC1sYXJnZWZpbGVzLnQ= 100644 --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -717,6 +717,12 @@ 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]