Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/rewriteutil.py @ 47087:d90f6237b3aa
rewriteutil: say how many commits would become orphan if commit is rewritten
This copies the message from the evolve extension, but modifies it a
bit to work with the grammar (in particular with the use of "change
branch of" as `action`). I don't know why it doesn't use the same
`_formatrevs()` as for public commmits.
Differential Revision: https://phab.mercurial-scm.org/D10671
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 04 May 2021 10:49:32 -0700 |
parents | 5b6dd0d9171b |
children | 055f7b9f2307 |
comparison
equal
deleted
inserted
replaced
47086:5b6dd0d9171b | 47087:d90f6237b3aa |
---|---|
78 | 78 |
79 newunstable = disallowednewunstable(repo, revs) | 79 newunstable = disallowednewunstable(repo, revs) |
80 if newunstable: | 80 if newunstable: |
81 hint = _(b"see 'hg help evolution.instability'") | 81 hint = _(b"see 'hg help evolution.instability'") |
82 raise error.InputError( | 82 raise error.InputError( |
83 _(b"cannot %s changeset with children") % action, hint=hint | 83 _(b"cannot %s changeset, as that will orphan %d descendants") |
84 % (action, len(newunstable)), | |
85 hint=hint, | |
84 ) | 86 ) |
85 | 87 |
86 if not obsolete.isenabled(repo, obsolete.allowdivergenceopt): | 88 if not obsolete.isenabled(repo, obsolete.allowdivergenceopt): |
87 new_divergence = _find_new_divergence(repo, revs) | 89 new_divergence = _find_new_divergence(repo, revs) |
88 if new_divergence: | 90 if new_divergence: |