diff hgext3rd/topic/stack.py @ 2938:9872526fc39f

topic: show the t0 even if topic is not yet touched
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 15 Sep 2017 23:25:38 +0530
parents b54abc7e80e2
children 7759d040d48d
line wrap: on
line diff
--- 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