diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2623,11 +2623,6 @@ def amend(ui, repo, commitfunc, old, ext message = old.description() pureextra = extra.copy() - if 'amend_source' in pureextra: - del pureextra['amend_source'] - pureoldextra = old.extra() - if 'amend_source' in pureoldextra: - del pureoldextra['amend_source'] extra['amend_source'] = old.hex() new = context.memctx(repo, @@ -2645,7 +2640,7 @@ def amend(ui, repo, commitfunc, old, ext and newdesc == old.description() and user == old.user() and date == old.date() - and pureextra == pureoldextra): + and pureextra == old.extra()): # nothing changed. continuing here would create a new node # anyway because of the amend_source noise. # diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1682,9 +1682,6 @@ def _docommit(ui, repo, *pats, **opts): if not allowunstable and old.children(): raise error.Abort(_('cannot amend changeset with children')) - newextra = extra.copy() - newextra['branch'] = branch - extra = newextra # commitfunc is used only for temporary amend commit by cmdutil.amend def commitfunc(ui, repo, message, match, opts): return repo.commit(message,