diff hgext3rd/topic/__init__.py @ 6549:e45bfd1e0588

topic: don't write namespace into commit extras if there's no topic Topic namespace is considered a part of topic, but topic is more important than just namespace alone, so it doesn't make a lot of sense to have topic namespace on a commit unless it also has topic. We could simple ignore topic namespace in such cases, but it makes sense to not record it at all.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 06 Sep 2023 14:45:42 -0300
parents 445240ccb701
children 81e89d943a4e
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Thu Jul 27 16:39:43 2023 -0300
+++ b/hgext3rd/topic/__init__.py	Wed Sep 06 14:45:42 2023 -0300
@@ -954,6 +954,10 @@
     if constants.extrakey in extra and not extra[constants.extrakey]:
         extra = extra.copy()
         del extra[constants.extrakey]
+    if constants.extrakey not in extra and b'topic-namespace' in extra:
+        # if topic is not in extra, drop namespace as well
+        extra = extra.copy()
+        del extra[b'topic-namespace']
     # hg <= 4.9 (0e41f40b01cc)
     kwargs = {}
     if p1copies is not None: