##// END OF EJS Templates
narrow: send specs as bundle2 data instead of param (issue5952) (issue6019)...
Pulkit Goyal -
r42307:8a37c9b6 default draft
parent child Browse files
Show More
@@ -144,6 +144,15 b' def getbundlechangegrouppart_narrow(bund'
144 def _handlechangespec_2(op, inpart):
144 def _handlechangespec_2(op, inpart):
145 includepats = set(inpart.params.get(_SPECPART_INCLUDE, '').splitlines())
145 includepats = set(inpart.params.get(_SPECPART_INCLUDE, '').splitlines())
146 excludepats = set(inpart.params.get(_SPECPART_EXCLUDE, '').splitlines())
146 excludepats = set(inpart.params.get(_SPECPART_EXCLUDE, '').splitlines())
147 data = inpart.read()
148 # old servers don't send includes and excludes using bundle2 data, they use
149 # bundle2 parameters instead.
150 if data:
151 inc, exc = data.split('\0')
152 if inc:
153 includepats |= set(inc.splitlines())
154 if exc:
155 excludepats |= set(exc.splitlines())
147 narrowspec.validatepatterns(includepats)
156 narrowspec.validatepatterns(includepats)
148 narrowspec.validatepatterns(excludepats)
157 narrowspec.validatepatterns(excludepats)
149
158
@@ -2214,12 +2214,14 b' def _getbundlechangegrouppart(bundler, r'
2214 if (kwargs.get(r'narrow', False) and kwargs.get(r'narrow_acl', False)
2214 if (kwargs.get(r'narrow', False) and kwargs.get(r'narrow_acl', False)
2215 and (include or exclude)):
2215 and (include or exclude)):
2216 narrowspecpart = bundler.newpart('narrow:spec')
2216 narrowspecpart = bundler.newpart('narrow:spec')
2217 data = ''
2217 if include:
2218 if include:
2218 narrowspecpart.addparam(
2219 data += '\n'.join(include)
2219 'include', '\n'.join(include), mandatory=True)
2220 data += '\0'
2220 if exclude:
2221 if exclude:
2221 narrowspecpart.addparam(
2222 data += '\n'.join(exclude)
2222 'exclude', '\n'.join(exclude), mandatory=True)
2223
2224 narrowspecpart.data = data
2223
2225
2224 @getbundle2partsgenerator('bookmarks')
2226 @getbundle2partsgenerator('bookmarks')
2225 def _getbundlebookmarkpart(bundler, repo, source, bundlecaps=None,
2227 def _getbundlebookmarkpart(bundler, repo, source, bundlecaps=None,
General Comments 0
You need to be logged in to leave comments. Login now