--- 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
--- 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
-------------------
--- 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