Mercurial > public > mercurial-scm > hg
comparison mercurial/shelve.py @ 50052:1b044a63a98a
shelve: adjust what happens in some `changing_parents` context
It seems like the rest is more about changing tracked_files, so we let start
with moving them out of the `changing_parents` contexts.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 15 Dec 2022 06:22:23 +0100 |
parents | 7a8bfc05b691 |
children | 5327ae76b740 |
comparison
equal
deleted
inserted
replaced
50051:9409f2946f16 | 50052:1b044a63a98a |
---|---|
869 targetphase = _target_phase(repo) | 869 targetphase = _target_phase(repo) |
870 overrides = {(b'phases', b'new-commit'): targetphase} | 870 overrides = {(b'phases', b'new-commit'): targetphase} |
871 with repo.ui.configoverride(overrides, b'unshelve'): | 871 with repo.ui.configoverride(overrides, b'unshelve'): |
872 with repo.dirstate.changing_parents(repo): | 872 with repo.dirstate.changing_parents(repo): |
873 repo.setparents(state.parents[0], repo.nullid) | 873 repo.setparents(state.parents[0], repo.nullid) |
874 newnode, ispartialunshelve = _createunshelvectx( | 874 newnode, ispartialunshelve = _createunshelvectx( |
875 ui, repo, shelvectx, basename, interactive, opts | 875 ui, repo, shelvectx, basename, interactive, opts |
876 ) | 876 ) |
877 | 877 |
878 if newnode is None: | 878 if newnode is None: |
879 shelvectx = state.pendingctx | 879 shelvectx = state.pendingctx |
880 msg = _( | 880 msg = _( |
881 b'note: unshelved changes already existed ' | 881 b'note: unshelved changes already existed ' |
1068 ) | 1068 ) |
1069 raise error.ConflictResolutionRequired(b'unshelve') | 1069 raise error.ConflictResolutionRequired(b'unshelve') |
1070 | 1070 |
1071 with repo.dirstate.changing_parents(repo): | 1071 with repo.dirstate.changing_parents(repo): |
1072 repo.setparents(tmpwctx.node(), repo.nullid) | 1072 repo.setparents(tmpwctx.node(), repo.nullid) |
1073 newnode, ispartialunshelve = _createunshelvectx( | 1073 newnode, ispartialunshelve = _createunshelvectx( |
1074 ui, repo, shelvectx, basename, interactive, opts | 1074 ui, repo, shelvectx, basename, interactive, opts |
1075 ) | 1075 ) |
1076 | 1076 |
1077 if newnode is None: | 1077 if newnode is None: |
1078 shelvectx = tmpwctx | 1078 shelvectx = tmpwctx |
1079 msg = _( | 1079 msg = _( |
1080 b'note: unshelved changes already existed ' | 1080 b'note: unshelved changes already existed ' |