This enforces the copy on write logic. Otherwise independant unrelated branches
could affected each other.
More testing of these case are coming, but I need that code landed to unlock
other performance work in parallel.
| pulkit |
| hg-reviewers |
This enforces the copy on write logic. Otherwise independant unrelated branches
could affected each other.
More testing of these case are coming, but I need that code landed to unlock
other performance work in parallel.
| No Linters Available |
| No Unit Test Coverage |
| Path | Packages | |||
|---|---|---|---|---|
| M | mercurial/copies.py (7 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| 8d54944eaeb0 | 6c960b708ac4 | Pierre-Yves David | Nov 20 2020, 4:51 AM |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | marmoute | ||
| Closed | Alphare | ||
| Closed | Alphare | ||
| Closed | indygreg | ||
| Closed | mharbison72 | ||
| Closed | Alphare | ||
| Closed | marmoute | ||
| Closed | SimonSapin | ||
| Closed | SimonSapin | ||
| Closed | SimonSapin | ||
| Closed | martinvonz |
| # we are the second parent to work on c, we need to merge our | # we are the second parent to work on c, we need to merge our | ||||
| # work with the other. | # work with the other. | ||||
| # | # | ||||
| # In case of conflict, parent 1 take precedence over parent 2. | # In case of conflict, parent 1 take precedence over parent 2. | ||||
| # This is an arbitrary choice made anew when implementing | # This is an arbitrary choice made anew when implementing | ||||
| # changeset based copies. It was made without regards with | # changeset based copies. It was made without regards with | ||||
| # potential filelog related behavior. | # potential filelog related behavior. | ||||
| if parent == 1: | if parent == 1: | ||||
| if newcopies is copies: | |||||
| newcopies = copies.copy() | |||||
| minor, major = othercopies, newcopies | minor, major = othercopies, newcopies | ||||
| else: | else: | ||||
| minor, major = newcopies, othercopies | # we do not know if the other dict is a copy or not, so we | ||||
| # need to blindly copy it. Future change should make this | |||||
| # unnecessary. | |||||
| minor, major = newcopies, othercopies.copy() | |||||
| copies = _merge_copies_dict(minor, major, isancestor, changes) | copies = _merge_copies_dict(minor, major, isancestor, changes) | ||||
| all_copies[c] = copies | all_copies[c] = copies | ||||
| final_copies = {} | final_copies = {} | ||||
| for dest, (tt, source) in all_copies[targetrev].items(): | for dest, (tt, source) in all_copies[targetrev].items(): | ||||
| if source is not None: | if source is not None: | ||||
| final_copies[dest] = source | final_copies[dest] = source | ||||
| return final_copies | return final_copies | ||||