diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py --- a/hgext/narrow/narrowcommands.py +++ b/hgext/narrow/narrowcommands.py @@ -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(): diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1688,8 +1688,8 @@ bundler.prefercompressed = False # get the inlcudes and excludes - includepats = kwargs[r'includepats'] - excludepats = kwargs[r'excludepats'] + includepats = kwargs.get(r'includepats') + excludepats = kwargs.get(r'excludepats') narrowstream = repo.ui.configbool('server', 'stream-narrow-clones')