Commit 4b4b0522 authored by Sushil Khanchi's avatar Sushil Khanchi 🐨
Browse files

evolve: fix a bug in logic of choosing destination for hg update

--HG--
branch : stable
parent abefd37c6afa
......@@ -66,13 +66,15 @@ def _destupdatetopic(repo, clean, check=None):
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
......
......@@ -512,5 +512,6 @@ destination check: when active topic is empty
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment