820 |
819 |
821 shelvectx = repo[state.parents[1]] |
820 shelvectx = repo[state.parents[1]] |
822 pendingctx = state.pendingctx |
821 pendingctx = state.pendingctx |
823 |
822 |
824 with repo.dirstate.parentchange(): |
823 with repo.dirstate.parentchange(): |
825 repo.setparents(state.pendingctx.node(), nullid) |
824 repo.setparents(state.pendingctx.node(), repo.nullid) |
826 repo.dirstate.write(repo.currenttransaction()) |
825 repo.dirstate.write(repo.currenttransaction()) |
827 |
826 |
828 targetphase = phases.internal |
827 targetphase = phases.internal |
829 if not phases.supportinternal(repo): |
828 if not phases.supportinternal(repo): |
830 targetphase = phases.secret |
829 targetphase = phases.secret |
831 overrides = {(b'phases', b'new-commit'): targetphase} |
830 overrides = {(b'phases', b'new-commit'): targetphase} |
832 with repo.ui.configoverride(overrides, b'unshelve'): |
831 with repo.ui.configoverride(overrides, b'unshelve'): |
833 with repo.dirstate.parentchange(): |
832 with repo.dirstate.parentchange(): |
834 repo.setparents(state.parents[0], nullid) |
833 repo.setparents(state.parents[0], repo.nullid) |
835 newnode, ispartialunshelve = _createunshelvectx( |
834 newnode, ispartialunshelve = _createunshelvectx( |
836 ui, repo, shelvectx, basename, interactive, opts |
835 ui, repo, shelvectx, basename, interactive, opts |
837 ) |
836 ) |
838 |
837 |
839 if newnode is None: |
838 if newnode is None: |
1025 interactive, |
1024 interactive, |
1026 ) |
1025 ) |
1027 raise error.ConflictResolutionRequired(b'unshelve') |
1026 raise error.ConflictResolutionRequired(b'unshelve') |
1028 |
1027 |
1029 with repo.dirstate.parentchange(): |
1028 with repo.dirstate.parentchange(): |
1030 repo.setparents(tmpwctx.node(), nullid) |
1029 repo.setparents(tmpwctx.node(), repo.nullid) |
1031 newnode, ispartialunshelve = _createunshelvectx( |
1030 newnode, ispartialunshelve = _createunshelvectx( |
1032 ui, repo, shelvectx, basename, interactive, opts |
1031 ui, repo, shelvectx, basename, interactive, opts |
1033 ) |
1032 ) |
1034 |
1033 |
1035 if newnode is None: |
1034 if newnode is None: |