hgext3rd/topic/stack.py
changeset 2938 9872526fc39f
parent 2937 b54abc7e80e2
child 2939 7759d040d48d
--- 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