##// END OF EJS Templates
widening: remove always-true condition in widening code...
Martin von Zweigbergk -
r43538:c5adf480 default
parent child Browse files
Show More
@@ -134,58 +134,57 b' def generate_ellipses_bundle2_for_wideni'
134
134
135 heads = set(heads or repo.heads())
135 heads = set(heads or repo.heads())
136 common = set(common or [nullid])
136 common = set(common or [nullid])
137 if known and (oldinclude != newinclude or oldexclude != newexclude):
137 # Steps:
138 # Steps:
138 # 1. Send kill for "$known & ::common"
139 # 1. Send kill for "$known & ::common"
139 #
140 #
140 # 2. Send changegroup for ::common
141 # 2. Send changegroup for ::common
141 #
142 #
142 # 3. Proceed.
143 # 3. Proceed.
143 #
144 #
144 # In the future, we can send kills for only the specific
145 # In the future, we can send kills for only the specific
145 # nodes we know should go away or change shape, and then
146 # nodes we know should go away or change shape, and then
146 # send a data stream that tells the client something like this:
147 # send a data stream that tells the client something like this:
147 #
148 #
148 # a) apply this changegroup
149 # a) apply this changegroup
149 # b) apply nodes XXX, YYY, ZZZ that you already have
150 # b) apply nodes XXX, YYY, ZZZ that you already have
150 # c) goto a
151 # c) goto a
151 #
152 #
152 # until they've built up the full new state.
153 # until they've built up the full new state.
153 # Convert to revnums and intersect with "common". The client should
154 # Convert to revnums and intersect with "common". The client should
154 # have made it a subset of "common" already, but let's be safe.
155 # have made it a subset of "common" already, but let's be safe.
155 known = set(repo.revs(b"%ln & ::%ln", known, common))
156 known = set(repo.revs(b"%ln & ::%ln", known, common))
156 # TODO: we could send only roots() of this set, and the
157 # TODO: we could send only roots() of this set, and the
157 # list of nodes in common, and the client could work out
158 # list of nodes in common, and the client could work out
158 # what to strip, instead of us explicitly sending every
159 # what to strip, instead of us explicitly sending every
159 # single node.
160 # single node.
160 deadrevs = known
161 deadrevs = known
162
161
163 def genkills():
162 def genkills():
164 for r in deadrevs:
163 for r in deadrevs:
165 yield _KILLNODESIGNAL
164 yield _KILLNODESIGNAL
166 yield repo.changelog.node(r)
165 yield repo.changelog.node(r)
167 yield _DONESIGNAL
166 yield _DONESIGNAL
168
167
169 bundler.newpart(_CHANGESPECPART, data=genkills())
168 bundler.newpart(_CHANGESPECPART, data=genkills())
170 newvisit, newfull, newellipsis = exchange._computeellipsis(
169 newvisit, newfull, newellipsis = exchange._computeellipsis(
171 repo, set(), common, known, newmatch
170 repo, set(), common, known, newmatch
171 )
172 if newvisit:
173 packer = changegroup.getbundler(
174 version,
175 repo,
176 matcher=newmatch,
177 ellipses=True,
178 shallow=depth is not None,
179 ellipsisroots=newellipsis,
180 fullnodes=newfull,
172 )
181 )
173 if newvisit:
182 cgdata = packer.generate(common, newvisit, False, b'narrow_widen')
174 packer = changegroup.getbundler(
175 version,
176 repo,
177 matcher=newmatch,
178 ellipses=True,
179 shallow=depth is not None,
180 ellipsisroots=newellipsis,
181 fullnodes=newfull,
182 )
183 cgdata = packer.generate(common, newvisit, False, b'narrow_widen')
184
183
185 part = bundler.newpart(b'changegroup', data=cgdata)
184 part = bundler.newpart(b'changegroup', data=cgdata)
186 part.addparam(b'version', version)
185 part.addparam(b'version', version)
187 if b'treemanifest' in repo.requirements:
186 if b'treemanifest' in repo.requirements:
188 part.addparam(b'treemanifest', b'1')
187 part.addparam(b'treemanifest', b'1')
189
188
190 visitnodes, relevant_nodes, ellipsisroots = exchange._computeellipsis(
189 visitnodes, relevant_nodes, ellipsisroots = exchange._computeellipsis(
191 repo, common, heads, set(), newmatch, depth=depth
190 repo, common, heads, set(), newmatch, depth=depth
General Comments 0
You need to be logged in to leave comments. Login now