comparison mercurial/commands.py @ 27973:ce9696193175 stable

amend: don't preserve most extra fields This backs out changeset 39163708825cd. There are some extra fields that absolutely should not be preserved, like the convert_revision field introduced by the convert and hgsubversion extensions. The problem with extensions blacklisting certain extra fields is that they might not be enabled at the time the amend is performed. In the long run we probably want separately marked transferable and non-transferable extra fields, but for now restore the old Mercurial 3.6 behavior.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 03 Feb 2016 08:59:46 -0800
parents 9960b6369e7f
children bb14a81ce647
comparison
equal deleted inserted replaced
27972:92a61d7618ac 27973:ce9696193175
1680 raise error.Abort(_('cannot amend while merging')) 1680 raise error.Abort(_('cannot amend while merging'))
1681 allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt) 1681 allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt)
1682 if not allowunstable and old.children(): 1682 if not allowunstable and old.children():
1683 raise error.Abort(_('cannot amend changeset with children')) 1683 raise error.Abort(_('cannot amend changeset with children'))
1684 1684
1685 newextra = extra.copy()
1686 newextra['branch'] = branch
1687 extra = newextra
1688 # commitfunc is used only for temporary amend commit by cmdutil.amend 1685 # commitfunc is used only for temporary amend commit by cmdutil.amend
1689 def commitfunc(ui, repo, message, match, opts): 1686 def commitfunc(ui, repo, message, match, opts):
1690 return repo.commit(message, 1687 return repo.commit(message,
1691 opts.get('user') or old.user(), 1688 opts.get('user') or old.user(),
1692 opts.get('date') or old.date(), 1689 opts.get('date') or old.date(),