changeset 40493:a2c4502e409b

narrow: only send includepats and excludepats if they are not empty If we send an empty includepats or excludepats argument to getbundle, it's translated to `['']` on the server which causes problems because even though it's empty, bool of that value if True and we end up creating differencematcher with narrowspec.match() which results in unexpected behavior. Differential Revision: https://phab.mercurial-scm.org/D5138
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 17 Oct 2018 17:24:55 +0300
parents 440f5b65be57
children 9aeb9e2d28a7
files hgext/narrow/narrowcommands.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/narrow/narrowcommands.py	Tue Oct 16 17:53:26 2018 +0300
+++ b/hgext/narrow/narrowcommands.py	Wed Oct 17 17:24:55 2018 +0300
@@ -141,8 +141,10 @@
     include, exclude = repo.narrowpats
     kwargs['oldincludepats'] = include
     kwargs['oldexcludepats'] = exclude
-    kwargs['includepats'] = include
-    kwargs['excludepats'] = exclude
+    if include:
+        kwargs['includepats'] = include
+    if exclude:
+        kwargs['excludepats'] = exclude
     # calculate known nodes only in ellipses cases because in non-ellipses cases
     # we have all the nodes
     if wireprototypes.ELLIPSESCAP in pullop.remote.capabilities():