# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1505498138 -19800 # Node ID 9872526fc39f7cee89c12f9572d61798ea84a12b # Parent b54abc7e80e290c644045e55a99e4abb18f8aa7d topic: show the t0 even if topic is not yet touched diff -r b54abc7e80e2 -r 9872526fc39f hgext3rd/topic/stack.py --- a/hgext3rd/topic/stack.py Fri Sep 15 23:13:05 2017 +0530 +++ b/hgext3rd/topic/stack.py Fri Sep 15 23:25:38 2017 +0530 @@ -131,9 +131,12 @@ # step 3: add t0 if revs: pt1 = self._repo[revs[0]].p1() - if pt1.obsolete(): - pt1 = self._repo[_singlesuccessor(self._repo, pt1)] - revs.insert(0, pt1.rev()) + else: + pt1 = self._repo['.'] + + if pt1.obsolete(): + pt1 = self._repo[_singlesuccessor(self._repo, pt1)] + revs.insert(0, pt1.rev()) return revs @util.propertycache diff -r b54abc7e80e2 -r 9872526fc39f tests/test-topic-stack.t --- a/tests/test-topic-stack.t Fri Sep 15 23:13:05 2017 +0530 +++ b/tests/test-topic-stack.t Fri Sep 15 23:25:38 2017 +0530 @@ -68,6 +68,7 @@ ### topic: other ### branch: default (stack is empty) + t0^ c_b (base) $ hg up foo switching to topic foo @@ -227,6 +228,7 @@ $ hg stack ### branch: default (stack is empty) + b0^ c_f (base) Test "t#" reference ------------------- diff -r b54abc7e80e2 -r 9872526fc39f tests/test-topic.t --- a/tests/test-topic.t Fri Sep 15 23:13:05 2017 +0530 +++ b/tests/test-topic.t Fri Sep 15 23:25:38 2017 +0530 @@ -144,6 +144,7 @@ ### topic: narf ### branch: default (stack is empty) + t0^ Add file delta (base) Add commits to topic