237 |
240 |
238 def compute_all_files_changes(ctx): |
241 def compute_all_files_changes(ctx): |
239 """compute the files changed by a revision""" |
242 """compute the files changed by a revision""" |
240 p1 = ctx.p1() |
243 p1 = ctx.p1() |
241 p2 = ctx.p2() |
244 p2 = ctx.p2() |
242 if p1.rev() == node.nullrev and p2.rev() == node.nullrev: |
245 if p1.rev() == nullrev and p2.rev() == nullrev: |
243 return _process_root(ctx) |
246 return _process_root(ctx) |
244 elif p1.rev() != node.nullrev and p2.rev() == node.nullrev: |
247 elif p1.rev() != nullrev and p2.rev() == nullrev: |
245 return _process_linear(p1, ctx) |
248 return _process_linear(p1, ctx) |
246 elif p1.rev() == node.nullrev and p2.rev() != node.nullrev: |
249 elif p1.rev() == nullrev and p2.rev() != nullrev: |
247 # In the wild, one can encounter changeset where p1 is null but p2 is not |
250 # In the wild, one can encounter changeset where p1 is null but p2 is not |
248 return _process_linear(p1, ctx, parent=2) |
251 return _process_linear(p1, ctx, parent=2) |
249 elif p1.rev() == p2.rev(): |
252 elif p1.rev() == p2.rev(): |
250 # In the wild, one can encounter such "non-merge" |
253 # In the wild, one can encounter such "non-merge" |
251 return _process_linear(p1, ctx) |
254 return _process_linear(p1, ctx) |
421 |
424 |
422 cahs = ctx.repo().changelog.commonancestorsheads( |
425 cahs = ctx.repo().changelog.commonancestorsheads( |
423 p1_ctx.node(), p2_ctx.node() |
426 p1_ctx.node(), p2_ctx.node() |
424 ) |
427 ) |
425 if not cahs: |
428 if not cahs: |
426 cahs = [node.nullrev] |
429 cahs = [nullrev] |
427 mas = [ctx.repo()[r].manifest() for r in cahs] |
430 mas = [ctx.repo()[r].manifest() for r in cahs] |
428 |
431 |
429 copy_candidates = [] |
432 copy_candidates = [] |
430 |
433 |
431 # Dealing with case 🄰 happens automatically. Since there are no entry in |
434 # Dealing with case 🄰 happens automatically. Since there are no entry in |
558 def mas(): |
561 def mas(): |
559 p1n = p1.node() |
562 p1n = p1.node() |
560 p2n = p2.node() |
563 p2n = p2.node() |
561 cahs = ctx.repo().changelog.commonancestorsheads(p1n, p2n) |
564 cahs = ctx.repo().changelog.commonancestorsheads(p1n, p2n) |
562 if not cahs: |
565 if not cahs: |
563 cahs = [node.nullrev] |
566 cahs = [nullrev] |
564 return [ctx.repo()[r].manifest() for r in cahs] |
567 return [ctx.repo()[r].manifest() for r in cahs] |
565 |
568 |
566 def deletionfromparent(f): |
569 def deletionfromparent(f): |
567 if f in m1: |
570 if f in m1: |
568 return f not in m2 and all( |
571 return f not in m2 and all( |