diff --git a/hgext3rd/topic/__init__.py b/hgext3rd/topic/__init__.py index a27bdd1167613be20699e3b392e0b3f23e61d244_aGdleHQzcmQvdG9waWMvX19pbml0X18ucHk=..5d1bfde39b95a733c1ed80488f400e218846cdc0_aGdleHQzcmQvdG9waWMvX19pbml0X18ucHk= 100644 --- a/hgext3rd/topic/__init__.py +++ b/hgext3rd/topic/__init__.py @@ -749,9 +749,7 @@ topic = None if util.safehasattr(rulectx, 'topic'): topic = rulectx.topic() - - if topic: - _changecurrenttopic(repo, topic) + _changecurrenttopic(repo, topic) # revset predicates are automatically registered at loading via this symbol diff --git a/tests/test-issue6550.t b/tests/test-issue6550.t index a27bdd1167613be20699e3b392e0b3f23e61d244_dGVzdHMvdGVzdC1pc3N1ZTY1NTAudA==..5d1bfde39b95a733c1ed80488f400e218846cdc0_dGVzdHMvdGVzdC1pc3N1ZTY1NTAudA== 100644 --- a/tests/test-issue6550.t +++ b/tests/test-issue6550.t @@ -47,3 +47,41 @@ o 0:c051488dac25 [topic1] A $ cd .. + +Editing commits without a topic on top of a commit with a topic: + + $ hg init repo2 + $ cd repo2 + $ hg topic topic1 + marked working directory as topic: topic1 + $ echo 1 > A + $ hg ci -Aqm A + $ hg topic --clear + $ echo 1 > B + $ hg ci -Aqm B + $ echo 1 > C + $ hg ci -Aqm C + $ hg glog + @ 2:c47acbb860b3 [] C + | + o 1:e2e2ca96a6bb [] B + | + o 0:c051488dac25 [topic1] A + +Swap the order of commits B and C + + $ hg histedit s1 -q --commands - 2>&1 << EOF + > pick c47acbb860b3 C + > pick e2e2ca96a6bb B + > EOF + +B and C still don't have a topic + + $ hg glog + @ 4:ff3439fe6f3d [] B + | + o 3:bb6fab1a29c6 [] C + | + o 0:c051488dac25 [topic1] A + + $ cd ..