Mercurial > hg
comparison hgext/narrow/narrowcommands.py @ 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 | 5d8f291405e5 |
children | 773572e5cba2 |
comparison
equal
deleted
inserted
replaced
40492:440f5b65be57 | 40493:a2c4502e409b |
---|---|
139 orig(pullop, kwargs) | 139 orig(pullop, kwargs) |
140 kwargs['narrow'] = True | 140 kwargs['narrow'] = True |
141 include, exclude = repo.narrowpats | 141 include, exclude = repo.narrowpats |
142 kwargs['oldincludepats'] = include | 142 kwargs['oldincludepats'] = include |
143 kwargs['oldexcludepats'] = exclude | 143 kwargs['oldexcludepats'] = exclude |
144 kwargs['includepats'] = include | 144 if include: |
145 kwargs['excludepats'] = exclude | 145 kwargs['includepats'] = include |
146 if exclude: | |
147 kwargs['excludepats'] = exclude | |
146 # calculate known nodes only in ellipses cases because in non-ellipses cases | 148 # calculate known nodes only in ellipses cases because in non-ellipses cases |
147 # we have all the nodes | 149 # we have all the nodes |
148 if wireprototypes.ELLIPSESCAP in pullop.remote.capabilities(): | 150 if wireprototypes.ELLIPSESCAP in pullop.remote.capabilities(): |
149 kwargs['known'] = [node.hex(ctx.node()) for ctx in | 151 kwargs['known'] = [node.hex(ctx.node()) for ctx in |
150 repo.set('::%ln', pullop.common) | 152 repo.set('::%ln', pullop.common) |