comparison mercurial/exchange.py @ 40337:cb516a854bc7

narrow: only send the narrowspecs back if ACL in play I am unable to think why we need to send narrowspecs back from the server. The current state adds a 'narrow:spec' part to each changegroup which is generated when narrow extension is enabled. So we are sending narrowspecs on pull also. There is a problem with sending the narrowspecs the way we are doing it right now. We add include and exclude as parameter of the 'narrow:spec' bundle2 part. The the len of include or exclude string increase 255 which is obvious while working on large repos, bundle2 generation code breaks. For more on that refer issue5952 on bugzilla. I was thinking why we need to send the narrowspecs back, and deleted the 'narrow:spec' bundle2 part generation code and found that only narrow-acl test has some failure. With this patch, we will only send the 'narrow:spec' bundle2 part if ACL is enabled because the original narrowspecs in those cases can be a subset of narrowspecs user requested. There are phase related output change in couple of tests. The output change shows that we are now dealing in public phases completely. So maybe sending the narrow:spec bundle2 part was preventing phases being exchanged or phase bundle2 data being applied. Differential Revision: https://phab.mercurial-scm.org/D4931
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 10 Oct 2018 17:36:59 +0300
parents ac59de55c8b4
children 2c5835b4246b
comparison
equal deleted inserted replaced
40336:d365e2b7aa2a 40337:cb516a854bc7
1905 .format(username, invalid_includes)) 1905 .format(username, invalid_includes))
1906 1906
1907 new_args = {} 1907 new_args = {}
1908 new_args.update(kwargs) 1908 new_args.update(kwargs)
1909 new_args[r'narrow'] = True 1909 new_args[r'narrow'] = True
1910 new_args[r'narrow_acl'] = True
1910 new_args[r'includepats'] = req_includes 1911 new_args[r'includepats'] = req_includes
1911 if req_excludes: 1912 if req_excludes:
1912 new_args[r'excludepats'] = req_excludes 1913 new_args[r'excludepats'] = req_excludes
1913 1914
1914 return new_args 1915 return new_args
2169 mandatory=False) 2170 mandatory=False)
2170 2171
2171 if 'treemanifest' in repo.requirements: 2172 if 'treemanifest' in repo.requirements:
2172 part.addparam('treemanifest', '1') 2173 part.addparam('treemanifest', '1')
2173 2174
2174 if kwargs.get(r'narrow', False) and (include or exclude): 2175 if (kwargs.get(r'narrow', False) and kwargs.get('narrow_acl', False)
2176 and (include or exclude)):
2175 narrowspecpart = bundler.newpart('narrow:spec') 2177 narrowspecpart = bundler.newpart('narrow:spec')
2176 if include: 2178 if include:
2177 narrowspecpart.addparam( 2179 narrowspecpart.addparam(
2178 'include', '\n'.join(include), mandatory=True) 2180 'include', '\n'.join(include), mandatory=True)
2179 if exclude: 2181 if exclude: