mercurial/shelve.py
changeset 50022 c166b212bdee
parent 49727 636cd96806a7
child 50023 7a8bfc05b691
equal deleted inserted replaced
50021:376395868b7b 50022:c166b212bdee
   635         match = _optimized_match(repo, node)
   635         match = _optimized_match(repo, node)
   636         _shelvecreatedcommit(repo, node, name, match)
   636         _shelvecreatedcommit(repo, node, name, match)
   637 
   637 
   638         ui.status(_(b'shelved as %s\n') % name)
   638         ui.status(_(b'shelved as %s\n') % name)
   639         if opts[b'keep']:
   639         if opts[b'keep']:
   640             with repo.dirstate.parentchange():
   640             with repo.dirstate.parentchange(repo):
   641                 scmutil.movedirstate(repo, parent, match)
   641                 scmutil.movedirstate(repo, parent, match)
   642         else:
   642         else:
   643             hg.update(repo, parent.node())
   643             hg.update(repo, parent.node())
   644             ms = mergestatemod.mergestate.read(repo)
   644             ms = mergestatemod.mergestate.read(repo)
   645             if not ms.unresolvedcount():
   645             if not ms.unresolvedcount():
   860             )
   860             )
   861 
   861 
   862         shelvectx = repo[state.parents[1]]
   862         shelvectx = repo[state.parents[1]]
   863         pendingctx = state.pendingctx
   863         pendingctx = state.pendingctx
   864 
   864 
   865         with repo.dirstate.parentchange():
   865         with repo.dirstate.parentchange(repo):
   866             repo.setparents(state.pendingctx.node(), repo.nullid)
   866             repo.setparents(state.pendingctx.node(), repo.nullid)
   867             repo.dirstate.write(repo.currenttransaction())
   867             repo.dirstate.write(repo.currenttransaction())
   868 
   868 
   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.parentchange():
   872             with repo.dirstate.parentchange(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 
  1066                 activebookmark,
  1066                 activebookmark,
  1067                 interactive,
  1067                 interactive,
  1068             )
  1068             )
  1069             raise error.ConflictResolutionRequired(b'unshelve')
  1069             raise error.ConflictResolutionRequired(b'unshelve')
  1070 
  1070 
  1071         with repo.dirstate.parentchange():
  1071         with repo.dirstate.parentchange(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