hgext/uncommit.py
changeset 48983 533820f5b997
parent 48913 f254fc73d956
parent 48979 9120c0cd935c
child 49959 c166b212bdee
equal deleted inserted replaced
48982:9dfbea54b680 48983:533820f5b997
   271 
   271 
   272         rewriteutil.precheck(repo, [curctx.rev()], b'unamend')
   272         rewriteutil.precheck(repo, [curctx.rev()], b'unamend')
   273         if len(curctx.parents()) > 1:
   273         if len(curctx.parents()) > 1:
   274             raise error.InputError(_(b"cannot unamend merge changeset"))
   274             raise error.InputError(_(b"cannot unamend merge changeset"))
   275 
   275 
       
   276         expected_keys = (b'amend_source', b'unamend_source')
       
   277         if not any(key in curctx.extra() for key in expected_keys):
       
   278             raise error.InputError(
       
   279                 _(
       
   280                     b"working copy parent was not created by 'hg amend' or "
       
   281                     b"'hg unamend'"
       
   282                 )
       
   283             )
       
   284 
   276         # identify the commit to which to unamend
   285         # identify the commit to which to unamend
   277         markers = list(predecessormarkers(curctx))
   286         markers = list(predecessormarkers(curctx))
   278         if len(markers) != 1:
   287         if len(markers) != 1:
   279             e = _(b"changeset must have one predecessor, found %i predecessors")
   288             e = _(b"changeset must have one predecessor, found %i predecessors")
   280             raise error.InputError(e % len(markers))
   289             raise error.InputError(e % len(markers))