Mercurial > hg
comparison hgext/absorb.py @ 42266:b3fc78c028ef
absorb: be more specific when erroring out on merge commit
When you have a merge commit checked out and run `hg absorb`, it would
tell you
abort: no mutable changeset to change
That makes it sound like the problem is public commits when isn't
really. Let's be more specific in this case.
There was already a test case that test this, so that now prints the
new message. I added a new test case that shows the old message (when
a public commit is checked out).
Differential Revision: https://phab.mercurial-scm.org/D6354
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 08 May 2019 21:25:23 -0700 |
parents | 537a8aeb9977 |
children | 86f17fc31aa8 |
comparison
equal
deleted
inserted
replaced
42265:65f3a77223e0 | 42266:b3fc78c028ef |
---|---|
912 if stack is None, the current draft stack will be used. | 912 if stack is None, the current draft stack will be used. |
913 return fixupstate. | 913 return fixupstate. |
914 """ | 914 """ |
915 if stack is None: | 915 if stack is None: |
916 limit = ui.configint('absorb', 'max-stack-size') | 916 limit = ui.configint('absorb', 'max-stack-size') |
917 stack = getdraftstack(repo['.'], limit) | 917 headctx = repo['.'] |
918 if len(headctx.parents()) > 1: | |
919 raise error.Abort(_('cannot absorb into a merge')) | |
920 stack = getdraftstack(headctx, limit) | |
918 if limit and len(stack) >= limit: | 921 if limit and len(stack) >= limit: |
919 ui.warn(_('absorb: only the recent %d changesets will ' | 922 ui.warn(_('absorb: only the recent %d changesets will ' |
920 'be analysed\n') | 923 'be analysed\n') |
921 % limit) | 924 % limit) |
922 if not stack: | 925 if not stack: |