Mercurial > evolve
comparison hgext3rd/topic/__init__.py @ 6417:c37754bb02d4 stable
topic: rename presplitupdatetopic() to wrappresplitupdate()
This makes it consistent with other functions that are used as an argument to
extensions.wrapfunction(). Also, more generic name allows to do more things
than just updating topic (like updating topic namespace as well).
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Tue, 21 Feb 2023 16:51:52 +0400 |
parents | 5fcb0cec5fe3 |
children | 50c4ed02ac6d |
comparison
equal
deleted
inserted
replaced
6416:5062ace47b9e | 6417:c37754bb02d4 |
---|---|
468 extensions.wrapcommand(commands.table, b'summary', wrap_summary) | 468 extensions.wrapcommand(commands.table, b'summary', wrap_summary) |
469 | 469 |
470 try: | 470 try: |
471 evolve = extensions.find(b'evolve') | 471 evolve = extensions.find(b'evolve') |
472 extensions.wrapfunction(evolve.rewriteutil, "presplitupdate", | 472 extensions.wrapfunction(evolve.rewriteutil, "presplitupdate", |
473 presplitupdatetopic) | 473 wrappresplitupdate) |
474 except (KeyError, AttributeError): | 474 except (KeyError, AttributeError): |
475 pass | 475 pass |
476 | 476 |
477 cmdutil.summaryhooks.add(b'topic', summaryhook) | 477 cmdutil.summaryhooks.add(b'topic', summaryhook) |
478 | 478 |
1602 cmdutil.extrapreimportmap[b'topic'] = _importtopic | 1602 cmdutil.extrapreimportmap[b'topic'] = _importtopic |
1603 patch.patchheadermap.append((b'EXP-Topic', b'topic')) | 1603 patch.patchheadermap.append((b'EXP-Topic', b'topic')) |
1604 | 1604 |
1605 ## preserve topic during split | 1605 ## preserve topic during split |
1606 | 1606 |
1607 def presplitupdatetopic(original, repo, ui, prev, ctx): | 1607 def wrappresplitupdate(original, repo, ui, prev, ctx): |
1608 # Save topic of revision | 1608 # Save topic of revision |
1609 topic = None | 1609 topic = None |
1610 if util.safehasattr(ctx, 'topic'): | 1610 if util.safehasattr(ctx, 'topic'): |
1611 topic = ctx.topic() | 1611 topic = ctx.topic() |
1612 | 1612 |