comparison hgext3rd/topic/__init__.py @ 6146:74665d83fb3b

branching: merge stable into default
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 21 Feb 2022 18:26:25 +0300
parents 5d1bfde39b95
children 453302ef7f79
comparison
equal deleted inserted replaced
6145:1a20edff5cbd 6146:74665d83fb3b
438 extensions.wrapfunction(evolve.safeguard, '_checkpublish', 438 extensions.wrapfunction(evolve.safeguard, '_checkpublish',
439 flow.replacecheckpublish) 439 flow.replacecheckpublish)
440 except (KeyError, AttributeError): 440 except (KeyError, AttributeError):
441 pass 441 pass
442 442
443 try:
444 histedit = extensions.find(b'histedit')
445 except KeyError:
446 pass
447 else:
448 # Make histedit preserve topics of edited commits
449 extensions.wrapfunction(histedit.histeditaction, 'applychange',
450 applychangewrap)
451
443 server.setupserver(ui) 452 server.setupserver(ui)
444 453
445 def reposetup(ui, repo): 454 def reposetup(ui, repo):
446 if not isinstance(repo, localrepo.localrepository): 455 if not isinstance(repo, localrepo.localrepository):
447 return # this can be a peer in the ssh case (puzzling) 456 return # this can be a peer in the ssh case (puzzling)
729 kwargs['filesadded'] = filesadded 738 kwargs['filesadded'] = filesadded
730 if filesremoved is not None: 739 if filesremoved is not None:
731 kwargs['filesremoved'] = filesremoved 740 kwargs['filesremoved'] = filesremoved
732 return orig(cl, manifest, files, desc, transaction, p1, p2, user, 741 return orig(cl, manifest, files, desc, transaction, p1, p2, user,
733 date=date, extra=extra, **kwargs) 742 date=date, extra=extra, **kwargs)
743
744 def applychangewrap(orig, self):
745 orig(self)
746 repo = self.repo
747 rulectx = repo[self.node]
748
749 topic = None
750 if util.safehasattr(rulectx, 'topic'):
751 topic = rulectx.topic()
752 _changecurrenttopic(repo, topic)
753
734 754
735 # revset predicates are automatically registered at loading via this symbol 755 # revset predicates are automatically registered at loading via this symbol
736 revsetpredicate = topicrevset.revsetpredicate 756 revsetpredicate = topicrevset.revsetpredicate
737 757
738 @command(b'topics', [ 758 @command(b'topics', [