# HG changeset patch # User Anton Shestakov # Date 1724158910 -14400 # Node ID c539a2fb600dfc54b0a8ad48ce39c66b52524516 # Parent 3977624060dc73446da757ebba65aa2ab1ede2fb topic: add fqbn method to dirstate to use instead of repo[None].fqbn() This is closer to what `hg branch` does in core. diff -r 3977624060dc -r c539a2fb600d hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Sun Feb 25 17:55:06 2024 -0300 +++ b/hgext3rd/topic/__init__.py Tue Aug 20 17:01:50 2024 +0400 @@ -979,6 +979,12 @@ if ce: ce.refresh() + def fqbn(self): + branch = encoding.tolocal(self._branch) + tns = encoding.tolocal(self._tns) + topic = encoding.tolocal(self._topic) + return common.formatfqbn(branch, tns, topic) + dirstate.dirstate = topicdirstate templatekeyword = registrar.templatekeyword() @@ -1744,7 +1750,7 @@ def wrap_branch_cmd(orig, ui, repo, label=None, **opts): if not opts.get('clean') and not label and not opts.get('rev'): - ui.write(b'%s\n' % repo[None].fqbn()) + ui.write(b'%s\n' % repo.dirstate.fqbn()) return return orig(ui, repo, label=label, **opts)