hgext3rd/topic/destination.py
branchstable
changeset 5024 b1a9d548af52
parent 4814 48b30ff742cb
child 5026 e7949274c3f9
--- a/hgext3rd/topic/destination.py	Fri Dec 20 17:17:30 2019 +0530
+++ b/hgext3rd/topic/destination.py	Fri Dec 20 17:31:57 2019 +0530
@@ -66,13 +66,15 @@
         return None, None, None
     movemark = node = None
     topic = repo.currenttopic
+    revs = []
     if topic:
         revs = repo.revs(b'.::topic(%s)', topic)
     else:
-        revs = []
-    if not revs:
         return None, None, None
-    node = revs.last()
+    if revs:
+        node = revs.last()
+    else:
+        node = repo[b'.'].node()
     if bookmarks.isactivewdirparent(repo):
         movemark = repo[b'.'].node()
     return node, movemark, None