D4013: exchange: make narrow ACL presence imply narrow=True

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Wed Aug 1 17:04:27 UTC 2018


indygreg created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4013

AFFECTED FILES
  hgext/narrow/narrowbundle2.py
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -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):
diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -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)



To: indygreg, durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list