Mercurial > hg-stable
comparison tests/test-amend.t @ 47061:ba6881c6a178
rewriteutil: check for divergence
This code is adapted from the code in the evolve extension. It seems
to be equivalent as far as the evolve extension's test suite can tell
(the only impact when making their `precheck()` delegate to our
version is that error messages are less detailed).
I had to change the error message to work with "change branch of"
being inserted as the action.
Differential Revision: https://phab.mercurial-scm.org/D10518
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 23 Feb 2021 10:28:42 -0800 |
parents | 7a90fddb13b0 |
children | 5b6dd0d9171b |
comparison
equal
deleted
inserted
replaced
47060:c4dbbaecaad3 | 47061:ba6881c6a178 |
---|---|
230 [10] | 230 [10] |
231 $ hg amend --note "adding bar" | 231 $ hg amend --note "adding bar" |
232 $ hg debugobsolete -r . | 232 $ hg debugobsolete -r . |
233 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} | 233 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} |
234 be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'} | 234 be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'} |
235 | |
236 Cannot cause divergence by default | |
237 | |
238 $ hg co --hidden 1 | |
239 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
240 $ hg amend -m divergent | |
241 abort: cannot amend 112478962961, as that creates content-divergence with 16084da537dd | |
242 (add --verbose for details) | |
243 [10] | |
244 $ hg amend -m divergent --config experimental.evolution.allowdivergence=true | |
245 2 new content-divergent changesets | |
235 #endif | 246 #endif |
236 | 247 |
237 Cannot amend public changeset | 248 Cannot amend public changeset |
238 | 249 |
239 $ hg phase -r A --public | 250 $ hg phase -r A --public |