# HG changeset patch # User Gregory Szorc # Date 1532824400 25200 # Node ID 98df52d5042c73b37324df6dc8533d3241608bb3 # Parent 5742d0428ed9b0b94d880ba572512ff92c9d6011 exchange: make narrow ACL presence imply narrow=True And refactor the logic for determining when to invoke our custom changegroup part function so it is only conditional on narrow being set. This makes it more obvious under which conditions we should invoke the custom implementation. Also use raw strings so **kwargs works on Python 3. Differential Revision: https://phab.mercurial-scm.org/D4013 diff -r 5742d0428ed9 -r 98df52d5042c hgext/narrow/narrowbundle2.py --- a/hgext/narrow/narrowbundle2.py Sat Jul 28 14:52:46 2018 -0700 +++ b/hgext/narrow/narrowbundle2.py Sat Jul 28 17:33:20 2018 -0700 @@ -309,9 +309,9 @@ def wrappedcgfn(*args, **kwargs): repo = args[1] if repo.ui.has_section(_NARROWACL_SECTION): - getbundlechangegrouppart_narrow( - *args, **exchange.applynarrowacl(repo, kwargs)) - elif kwargs.get(r'narrow', False): + kwargs = exchange.applynarrowacl(repo, kwargs) + + if kwargs.get(r'narrow', False): getbundlechangegrouppart_narrow(*args, **kwargs) else: origcgfn(*args, **kwargs) diff -r 5742d0428ed9 -r 98df52d5042c mercurial/exchange.py --- a/mercurial/exchange.py Sat Jul 28 14:52:46 2018 -0700 +++ b/mercurial/exchange.py Sat Jul 28 17:33:20 2018 -0700 @@ -1872,9 +1872,11 @@ new_args = {} new_args.update(kwargs) - new_args['includepats'] = req_includes + new_args[r'narrow'] = True + new_args[r'includepats'] = req_includes if req_excludes: - new_args['excludepats'] = req_excludes + new_args[r'excludepats'] = req_excludes + return new_args def _computeellipsis(repo, common, heads, known, match, depth=None):