evolve: fix a bug in logic to choose destination when no active topic stable
authorSushil khanchi <sushilkhanchi97@gmail.com>
Fri, 20 Dec 2019 17:39:44 +0530
branchstable
changeset 5026 e7949274c3f9
parent 5025 21168e99ba88
child 5034 1015a1dbaf7c
evolve: fix a bug in logic to choose destination when no active topic
hgext3rd/topic/destination.py
tests/test-topic-dest.t
--- a/hgext3rd/topic/destination.py	Fri Dec 20 17:32:07 2019 +0530
+++ b/hgext3rd/topic/destination.py	Fri Dec 20 17:39:44 2019 +0530
@@ -10,6 +10,7 @@
 from . import (
     common,
     topicmap,
+    constants,
 )
 from .evolvebits import builddependencies
 
@@ -66,9 +67,10 @@
         return None, None, None
     movemark = node = None
     topic = repo.currenttopic
-    revs = []
     if topic:
         revs = repo.revs(b'.::topic(%s)', topic)
+    elif constants.extrakey in repo[b'.'].extra():
+        revs = []
     else:
         return None, None, None
     if revs:
--- a/tests/test-topic-dest.t	Fri Dec 20 17:32:07 2019 +0530
+++ b/tests/test-topic-dest.t	Fri Dec 20 17:39:44 2019 +0530
@@ -526,5 +526,6 @@
   active topic 'foo' grew its first changeset
   (see 'hg help topics' for more information)
   $ hg topic --clear
-  $ hg up 2>&1 | grep "AssertionError"
-  AssertionError: any revision has at least one descendant branch head
+  $ hg up
+  switching to topic foo
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved