diff --git a/hgext/uncommit.py b/hgext/uncommit.py --- a/hgext/uncommit.py +++ b/hgext/uncommit.py @@ -273,6 +273,15 @@ def unamend(ui, repo, **opts): if len(curctx.parents()) > 1: raise error.InputError(_(b"cannot unamend merge changeset")) + expected_keys = (b'amend_source', b'unamend_source') + if not any(key in curctx.extra() for key in expected_keys): + raise error.InputError( + _( + b"working copy parent was not created by 'hg amend' or " + b"'hg unamend'" + ) + ) + # identify the commit to which to unamend markers = list(predecessormarkers(curctx)) if len(markers) != 1: diff --git a/i18n/ja.po b/i18n/ja.po --- a/i18n/ja.po +++ b/i18n/ja.po @@ -26642,7 +26642,7 @@ msgstr "" msgid "" "``pullbundle``\n" -" When set, the server will check pullbundle.manifest for bundles\n" +" When set, the server will check pullbundles.manifest for bundles\n" " covering the requested heads and common nodes. The first matching\n" " entry will be streamed to the client." msgstr "" diff --git a/i18n/pt_BR.po b/i18n/pt_BR.po --- a/i18n/pt_BR.po +++ b/i18n/pt_BR.po @@ -27460,12 +27460,12 @@ msgstr "" msgid "" "``pullbundle``\n" -" When set, the server will check pullbundle.manifest for bundles\n" +" When set, the server will check pullbundles.manifest for bundles\n" " covering the requested heads and common nodes. The first matching\n" " entry will be streamed to the client." msgstr "" "``pullbundle``\n" -" Se definido, o servidor verificará pullbundle.manifest para\n" +" Se definido, o servidor verificará pullbundles.manifest para\n" " arquivos de bundle que contiverem as cabeças e nós comuns\n" " pedidos. A primeira entrada correspondente será enviadas para\n" " o cliente." diff --git a/mercurial/helptext/config.txt b/mercurial/helptext/config.txt --- a/mercurial/helptext/config.txt +++ b/mercurial/helptext/config.txt @@ -2293,7 +2293,7 @@ Controls generic server settings. effectively prevents concurrent pushes. ``pullbundle`` - When set, the server will check pullbundle.manifest for bundles + When set, the server will check pullbundles.manifest for bundles covering the requested heads and common nodes. The first matching entry will be streamed to the client. diff --git a/tests/test-pull-bundle.t b/tests/test-pull-bundle.t --- a/tests/test-pull-bundle.t +++ b/tests/test-pull-bundle.t @@ -194,7 +194,7 @@ Test recovery from misconfigured server * sending pullbundle "0.hg" (glob) $ rm repo/.hg/blackbox.log -Test processing when nodes used in the pullbundle.manifest end up being hidden +Test processing when nodes used in the pullbundles.manifest end up being hidden $ hg --repo repo debugobsolete ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a 1 new obsolescence markers diff --git a/tests/test-unamend.t b/tests/test-unamend.t --- a/tests/test-unamend.t +++ b/tests/test-unamend.t @@ -39,8 +39,23 @@ Repo Setup Trying to unamend when there was no amend done $ hg unamend + abort: working copy parent was not created by 'hg amend' or 'hg unamend' + [10] + $ echo "bar" >> h + +Trying to unamend when the obsmarker is missing + + $ hg amend + $ hg debugobsolete --delete 0 + deleted 1 obsolescence markers + $ hg unamend abort: changeset must have one predecessor, found 0 predecessors [10] + $ hg strip tip --config extensions.strip= + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c9fa1a715c1b-06e5c233-backup.hg + $ hg up tip + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Unamend on clean wdir and tip