Mercurial > hg
comparison mercurial/merge.py @ 22405:6f63c47cbb86
dirstate: wrap setparent calls with begin/endparentchange (issue4353)
This wraps all the locations of dirstate.setparent with the appropriate
begin/endparentchange calls. This will prevent exceptions during those calls
from causing incoherent dirstates (issue4353).
author | Durham Goode <durham@fb.com> |
---|---|
date | Fri, 05 Sep 2014 11:36:20 -0700 |
parents | 8dda6f6ff564 |
children | 19903277f035 |
comparison
equal
deleted
inserted
replaced
22404:12bc7f06fc41 | 22405:6f63c47cbb86 |
---|---|
1132 repo.vfs.write('updatestate', p2.hex()) | 1132 repo.vfs.write('updatestate', p2.hex()) |
1133 | 1133 |
1134 stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels) | 1134 stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels) |
1135 | 1135 |
1136 if not partial: | 1136 if not partial: |
1137 repo.dirstate.beginparentchange() | |
1137 repo.setparents(fp1, fp2) | 1138 repo.setparents(fp1, fp2) |
1138 recordupdates(repo, actions, branchmerge) | 1139 recordupdates(repo, actions, branchmerge) |
1139 # update completed, clear state | 1140 # update completed, clear state |
1140 util.unlink(repo.join('updatestate')) | 1141 util.unlink(repo.join('updatestate')) |
1141 | 1142 |
1142 if not branchmerge: | 1143 if not branchmerge: |
1143 repo.dirstate.setbranch(p2.branch()) | 1144 repo.dirstate.setbranch(p2.branch()) |
1145 repo.dirstate.endparentchange() | |
1144 finally: | 1146 finally: |
1145 wlock.release() | 1147 wlock.release() |
1146 | 1148 |
1147 if not partial: | 1149 if not partial: |
1148 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3]) | 1150 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3]) |