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