--- 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
--- a/tests/test-topic-dest.t Fri Dec 20 17:17:30 2019 +0530
+++ b/tests/test-topic-dest.t Fri Dec 20 17:31:57 2019 +0530
@@ -512,5 +512,6 @@
adding a
$ hg topic foo
marked working directory as topic: foo
- $ hg up 2>&1 | grep "AssertionError"
- AssertionError: any branch has at least one head
+ $ hg up
+ clearing empty topic "foo"
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved