equal
deleted
inserted
replaced
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)) |