diff hgext3rd/topic/__init__.py @ 6656:d3668c704d40 stable

topic: use the appropriate functions to change topic and tns on wdir update This way we don't write the default topic/tns values into the files. It's safer this way if any of the default values change at some point (as it did for topic namespaces).
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 18 Jan 2024 14:32:41 -0300
parents 81fe0a498447
children 1c998ed77597
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Sat Jan 27 17:36:39 2024 -0300
+++ b/hgext3rd/topic/__init__.py	Thu Jan 18 14:32:41 2024 -0300
@@ -1704,10 +1704,10 @@
             if pctx.phase() > phases.public:
                 tns = pctx.topic_namespace()
                 t = pctx.topic()
-            repo.vfs.write(b'topic-namespace', tns)
+            _changecurrenttns(repo, tns)
             if tns != b'none' and tns != otns:
                 repo.ui.status(_(b"switching to topic-namespace %s\n") % tns)
-            repo.vfs.write(b'topic', t)
+            _changecurrenttopic(repo, t)
             if t and t != ot:
                 repo.ui.status(_(b"switching to topic %s\n") % t)
             if ot and not t: