Mercurial > hg-stable
comparison mercurial/cmdutil.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 | 02c5f8ad00ac |
children | 79139c7a88bd cb6a952efbf4 |
comparison
equal
deleted
inserted
replaced
27972:92a61d7618ac | 27973:ce9696193175 |
---|---|
2621 if not message: | 2621 if not message: |
2622 editor = getcommiteditor(edit=True, editform=editform) | 2622 editor = getcommiteditor(edit=True, editform=editform) |
2623 message = old.description() | 2623 message = old.description() |
2624 | 2624 |
2625 pureextra = extra.copy() | 2625 pureextra = extra.copy() |
2626 if 'amend_source' in pureextra: | |
2627 del pureextra['amend_source'] | |
2628 pureoldextra = old.extra() | |
2629 if 'amend_source' in pureoldextra: | |
2630 del pureoldextra['amend_source'] | |
2631 extra['amend_source'] = old.hex() | 2626 extra['amend_source'] = old.hex() |
2632 | 2627 |
2633 new = context.memctx(repo, | 2628 new = context.memctx(repo, |
2634 parents=[base.node(), old.p2().node()], | 2629 parents=[base.node(), old.p2().node()], |
2635 text=message, | 2630 text=message, |
2643 newdesc = changelog.stripdesc(new.description()) | 2638 newdesc = changelog.stripdesc(new.description()) |
2644 if ((not node) | 2639 if ((not node) |
2645 and newdesc == old.description() | 2640 and newdesc == old.description() |
2646 and user == old.user() | 2641 and user == old.user() |
2647 and date == old.date() | 2642 and date == old.date() |
2648 and pureextra == pureoldextra): | 2643 and pureextra == old.extra()): |
2649 # nothing changed. continuing here would create a new node | 2644 # nothing changed. continuing here would create a new node |
2650 # anyway because of the amend_source noise. | 2645 # anyway because of the amend_source noise. |
2651 # | 2646 # |
2652 # This not what we expect from amend. | 2647 # This not what we expect from amend. |
2653 return old.node() | 2648 return old.node() |