# HG changeset patch # User Anton Shestakov # Date 1689615299 10800 # Node ID 3d16c9a8cf3aa5b01f8478422a9ad0e770350cba # Parent 9ed87a0d93c7b929db31fc30fb7af4238fcb7963 topic: update topic namespace revset to use "none" as the default/empty value Follow-up for 963471ebe26a. diff -r 9ed87a0d93c7 -r 3d16c9a8cf3a hgext3rd/topic/revset.py --- a/hgext3rd/topic/revset.py Thu Jul 06 14:49:54 2023 -0300 +++ b/hgext3rd/topic/revset.py Mon Jul 17 14:34:59 2023 -0300 @@ -35,7 +35,7 @@ mutable = revset._notpublic(repo, revset.fullreposet(repo), ()) if not args: - return (subset & mutable).filter(lambda r: repo[r].topic_namespace() != b'default') + return (subset & mutable).filter(lambda r: repo[r].topic_namespace() != b'none') try: tns = getstringstrict(args[0], b'') @@ -50,7 +50,7 @@ def matches(r): tns = repo[r].topic_namespace() - if tns == b'default': + if tns == b'none': return False return matcher(tns) @@ -58,11 +58,11 @@ s = revset.getset(repo, revset.fullreposet(repo), x) namespaces = {repo[r].topic_namespace() for r in s} - namespaces.discard(b'default') + namespaces.discard(b'none') def matches(r): tns = repo[r].topic_namespace() - if tns == b'default': + if tns == b'none': return False return tns in namespaces diff -r 9ed87a0d93c7 -r 3d16c9a8cf3a tests/test-namespaces.t --- a/tests/test-namespaces.t Thu Jul 06 14:49:54 2023 -0300 +++ b/tests/test-namespaces.t Mon Jul 17 14:34:59 2023 -0300 @@ -78,6 +78,8 @@ > hg log -T '{rev}: {topic_namespace}\n' -r "$1" > } + $ nslog 'topicnamespace()' + 0: alice $ nslog 'topicnamespace(:)' 0: alice $ nslog 'topicnamespace(all())' diff -r 9ed87a0d93c7 -r 3d16c9a8cf3a tests/test-topic.t --- a/tests/test-topic.t Thu Jul 06 14:49:54 2023 -0300 +++ b/tests/test-topic.t Mon Jul 17 14:34:59 2023 -0300 @@ -848,6 +848,10 @@ abort: topic 'nonsense' does not exist [10] +Sanity checks for topicnamespace() revset + + $ tlog 'topicnamespace()' + Deactivate the topic. $ hg topics * fran (1 changesets)