comparison hgext3rd/topic/__init__.py @ 6032:2800aa3c3dbf

topic: drop the old workaround for detecting amends by amend_source We don't need to have this workaround because amends are handled differently now. See previous commits, where the old code for handling amends in topic extension gets removed. Various commits now preserve amend_source when going through the _changetopics function (used when changing a topic via the hg topics command).
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 30 Aug 2021 12:05:14 +0300
parents 30cde40dcd17
children 182e2a1dbd1c
comparison
equal deleted inserted replaced
6031:c3d66af4cb07 6032:2800aa3c3dbf
1075 if newtopic is None: 1075 if newtopic is None:
1076 del fixedextra[constants.extrakey] 1076 del fixedextra[constants.extrakey]
1077 else: 1077 else:
1078 fixedextra[constants.extrakey] = newtopic 1078 fixedextra[constants.extrakey] = newtopic
1079 fixedextra[constants.changekey] = c.hex() 1079 fixedextra[constants.changekey] = c.hex()
1080 if b'amend_source' in fixedextra:
1081 # TODO: right now the commitctx wrapper in
1082 # topicrepo overwrites the topic in extra if
1083 # amend_source is set to support 'hg commit
1084 # --amend'. Support for amend should be adjusted
1085 # to not be so invasive.
1086 del fixedextra[b'amend_source']
1087 ui.debug(b'changing topic of %s from %s to %s\n' % ( 1080 ui.debug(b'changing topic of %s from %s to %s\n' % (
1088 c, oldtopic or b'<none>', newtopic or b'<none>')) 1081 c, oldtopic or b'<none>', newtopic or b'<none>'))
1089 ui.debug(b'fixedextra: %r\n' % fixedextra) 1082 ui.debug(b'fixedextra: %r\n' % fixedextra)
1090 # While changing topic of set of linear commits, make sure that 1083 # While changing topic of set of linear commits, make sure that
1091 # we base our commits on new parent rather than old parent which 1084 # we base our commits on new parent rather than old parent which