Show More
@@ -599,7 +599,7 b' class changelog(revlog.revlog):' | |||
|
599 | 599 | l = [hex(manifest), user, parseddate] + sortedfiles + [b"", desc] |
|
600 | 600 | text = b"\n".join(l) |
|
601 | 601 | return self.addrevision( |
|
602 | text, transaction, len(self), p1, p2, sidedata=sidedata | |
|
602 | text, transaction, len(self), p1, p2, sidedata=sidedata, flags=flags | |
|
603 | 603 | ) |
|
604 | 604 | |
|
605 | 605 | def branchinfo(self, rev): |
@@ -24,6 +24,8 b' from . import (' | |||
|
24 | 24 | |
|
25 | 25 | from .utils import stringutil |
|
26 | 26 | |
|
27 | from .revlogutils import flagutil | |
|
28 | ||
|
27 | 29 | |
|
28 | 30 | def _filter(src, dst, t): |
|
29 | 31 | """filters out invalid copies after chaining""" |
@@ -179,6 +181,9 b' def _revinfo_getter(repo):' | |||
|
179 | 181 | """ |
|
180 | 182 | cl = repo.changelog |
|
181 | 183 | parents = cl.parentrevs |
|
184 | flags = cl.flags | |
|
185 | ||
|
186 | HASCOPIESINFO = flagutil.REVIDX_HASCOPIESINFO | |
|
182 | 187 | |
|
183 | 188 | changelogrevision = cl.changelogrevision |
|
184 | 189 | |
@@ -213,7 +218,10 b' def _revinfo_getter(repo):' | |||
|
213 | 218 | e = merge_caches.pop(rev, None) |
|
214 | 219 | if e is not None: |
|
215 | 220 | return e |
|
216 | value = (p1, p2, changelogrevision(rev).changes) | |
|
221 | changes = None | |
|
222 | if flags(rev) & HASCOPIESINFO: | |
|
223 | changes = changelogrevision(rev).changes | |
|
224 | value = (p1, p2, changes) | |
|
217 | 225 | if p1 != node.nullrev and p2 != node.nullrev: |
|
218 | 226 | # XXX some case we over cache, IGNORE |
|
219 | 227 | merge_caches[rev] = value |
@@ -293,13 +301,16 b' def _combine_changeset_copies(' | |||
|
293 | 301 | copies = {} |
|
294 | 302 | for i, c in enumerate(children[r]): |
|
295 | 303 | p1, p2, changes = revinfo(c) |
|
304 | childcopies = {} | |
|
296 | 305 | if r == p1: |
|
297 | 306 | parent = 1 |
|
298 | childcopies = changes.copied_from_p1 | |
|
307 | if changes is not None: | |
|
308 | childcopies = changes.copied_from_p1 | |
|
299 | 309 | else: |
|
300 | 310 | assert r == p2 |
|
301 | 311 | parent = 2 |
|
302 | childcopies = changes.copied_from_p2 | |
|
312 | if changes is not None: | |
|
313 | childcopies = changes.copied_from_p2 | |
|
303 | 314 | if not alwaysmatch: |
|
304 | 315 | childcopies = { |
|
305 | 316 | dst: src for dst, src in childcopies.items() if match(dst) |
@@ -313,14 +324,15 b' def _combine_changeset_copies(' | |||
|
313 | 324 | source = prev[1] |
|
314 | 325 | newcopies[dest] = (c, source) |
|
315 | 326 | assert newcopies is not copies |
|
316 |
|
|
|
317 |
|
|
|
318 |
if newcopies |
|
|
319 | # copy on write to avoid affecting potential other | |
|
320 | # branches. when there are no other branches, this | |
|
321 | # could be avoided. | |
|
322 |
|
|
|
323 |
newcopies |
|
|
327 | if changes is not None: | |
|
328 | for f in changes.removed: | |
|
329 | if f in newcopies: | |
|
330 | if newcopies is copies: | |
|
331 | # copy on write to avoid affecting potential other | |
|
332 | # branches. when there are no other branches, this | |
|
333 | # could be avoided. | |
|
334 | newcopies = copies.copy() | |
|
335 | newcopies[f] = (c, None) | |
|
324 | 336 | othercopies = all_copies.get(c) |
|
325 | 337 | if othercopies is None: |
|
326 | 338 | all_copies[c] = newcopies |
@@ -373,13 +385,21 b' def _merge_copies_dict(minor, major, isa' | |||
|
373 | 385 | # than the branch point or there is a merge |
|
374 | 386 | if new_tt == other_tt: |
|
375 | 387 | minor[dest] = value |
|
376 | elif value[1] is None and dest in changes.salvaged: | |
|
388 | elif ( | |
|
389 | changes is not None | |
|
390 | and value[1] is None | |
|
391 | and dest in changes.salvaged | |
|
392 | ): | |
|
377 | 393 | pass |
|
378 | elif other[1] is None and dest in changes.salvaged: | |
|
394 | elif ( | |
|
395 | changes is not None | |
|
396 | and other[1] is None | |
|
397 | and dest in changes.salvaged | |
|
398 | ): | |
|
379 | 399 | minor[dest] = value |
|
380 | 400 | elif not isancestor(new_tt, other_tt): |
|
381 | 401 | minor[dest] = value |
|
382 | elif dest in changes.merged: | |
|
402 | elif changes is not None and dest in changes.merged: | |
|
383 | 403 | minor[dest] = value |
|
384 | 404 | |
|
385 | 405 |
General Comments 0
You need to be logged in to leave comments.
Login now