mercurial/shelve.py
changeset 47012 d55b71393907
parent 46843 728d89f6f9b1
child 47436 6ecd0980d7f9
equal deleted inserted replaced
46992:5fa019ceb499 47012:d55b71393907
    29 
    29 
    30 from .i18n import _
    30 from .i18n import _
    31 from .node import (
    31 from .node import (
    32     bin,
    32     bin,
    33     hex,
    33     hex,
    34     nullid,
       
    35     nullrev,
    34     nullrev,
    36 )
    35 )
    37 from . import (
    36 from . import (
    38     bookmarks,
    37     bookmarks,
    39     bundle2,
    38     bundle2,
   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: